From dcdef818a565ea569e24404c5df5d5029593faf3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 29 Sep 2022 06:07:59 +0000 Subject: [PATCH] CodeGen from PR 20779 in Azure/azure-rest-api-specs add missing property to fix swagger issue in databox-v2022-02-01 (#20779) --- sdk/databox/azure-mgmt-databox/_meta.json | 11 + .../azure/mgmt/databox/__init__.py | 4 + .../azure/mgmt/databox/_configuration.py | 17 +- .../databox/_data_box_management_client.py | 103 +- .../azure/mgmt/databox/_operations_mixin.py | 63 + .../azure/mgmt/databox/_serialization.py | 2006 ++++++ .../azure/mgmt/databox/aio/_configuration.py | 17 +- .../aio/_data_box_management_client.py | 103 +- .../mgmt/databox/aio/_operations_mixin.py | 63 + .../azure/mgmt/databox/models.py | 2 +- .../mgmt/databox/v2018_01_01/__init__.py | 13 +- .../databox/v2018_01_01/_configuration.py | 58 +- .../_data_box_management_client.py | 88 +- .../mgmt/databox/v2018_01_01/_metadata.json | 81 +- .../azure/mgmt/databox/v2018_01_01/_patch.py | 20 + .../azure/mgmt/databox/v2018_01_01/_vendor.py | 27 + .../mgmt/databox/v2018_01_01/_version.py | 2 +- .../mgmt/databox/v2018_01_01/aio/__init__.py | 13 +- .../databox/v2018_01_01/aio/_configuration.py | 55 +- .../aio/_data_box_management_client.py | 77 +- .../mgmt/databox/v2018_01_01/aio/_patch.py | 20 + .../v2018_01_01/aio/operations/__init__.py | 12 +- .../aio/operations/_jobs_operations.py | 1328 ++-- .../v2018_01_01/aio/operations/_operations.py | 123 +- .../v2018_01_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 341 +- .../databox/v2018_01_01/models/__init__.py | 327 +- .../_data_box_management_client_enums.py | 321 +- .../databox/v2018_01_01/models/_models.py | 2212 ------ .../databox/v2018_01_01/models/_models_py3.py | 2337 ++++--- .../mgmt/databox/v2018_01_01/models/_patch.py | 20 + .../v2018_01_01/operations/__init__.py | 12 +- .../operations/_jobs_operations.py | 1638 +++-- .../v2018_01_01/operations/_operations.py | 153 +- .../databox/v2018_01_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 411 +- .../mgmt/databox/v2019_09_01/__init__.py | 13 +- .../databox/v2019_09_01/_configuration.py | 58 +- .../_data_box_management_client.py | 88 +- .../mgmt/databox/v2019_09_01/_metadata.json | 81 +- .../azure/mgmt/databox/v2019_09_01/_patch.py | 20 + .../azure/mgmt/databox/v2019_09_01/_vendor.py | 27 + .../mgmt/databox/v2019_09_01/_version.py | 2 +- .../mgmt/databox/v2019_09_01/aio/__init__.py | 13 +- .../databox/v2019_09_01/aio/_configuration.py | 55 +- .../aio/_data_box_management_client.py | 77 +- .../mgmt/databox/v2019_09_01/aio/_patch.py | 20 + .../v2019_09_01/aio/operations/__init__.py | 12 +- .../aio/operations/_jobs_operations.py | 1338 ++-- .../v2019_09_01/aio/operations/_operations.py | 123 +- .../v2019_09_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 953 ++- .../databox/v2019_09_01/models/__init__.py | 497 +- .../_data_box_management_client_enums.py | 440 +- .../databox/v2019_09_01/models/_models.py | 3351 --------- .../databox/v2019_09_01/models/_models_py3.py | 3702 +++++----- .../mgmt/databox/v2019_09_01/models/_patch.py | 20 + .../v2019_09_01/operations/__init__.py | 12 +- .../operations/_jobs_operations.py | 1657 +++-- .../v2019_09_01/operations/_operations.py | 153 +- .../databox/v2019_09_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1159 +++- .../mgmt/databox/v2020_04_01/__init__.py | 13 +- .../databox/v2020_04_01/_configuration.py | 58 +- .../_data_box_management_client.py | 88 +- .../mgmt/databox/v2020_04_01/_metadata.json | 81 +- .../azure/mgmt/databox/v2020_04_01/_patch.py | 20 + .../azure/mgmt/databox/v2020_04_01/_vendor.py | 27 + .../mgmt/databox/v2020_04_01/_version.py | 2 +- .../mgmt/databox/v2020_04_01/aio/__init__.py | 13 +- .../databox/v2020_04_01/aio/_configuration.py | 55 +- .../aio/_data_box_management_client.py | 77 +- .../mgmt/databox/v2020_04_01/aio/_patch.py | 20 + .../v2020_04_01/aio/operations/__init__.py | 12 +- .../aio/operations/_jobs_operations.py | 1356 ++-- .../v2020_04_01/aio/operations/_operations.py | 125 +- .../v2020_04_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 973 ++- .../databox/v2020_04_01/models/__init__.py | 587 +- .../_data_box_management_client_enums.py | 526 +- .../databox/v2020_04_01/models/_models.py | 3887 ----------- .../databox/v2020_04_01/models/_models_py3.py | 4345 ++++++------ .../mgmt/databox/v2020_04_01/models/_patch.py | 20 + .../v2020_04_01/operations/__init__.py | 12 +- .../operations/_jobs_operations.py | 1675 +++-- .../v2020_04_01/operations/_operations.py | 155 +- .../databox/v2020_04_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1188 +++- .../mgmt/databox/v2020_11_01/__init__.py | 13 +- .../databox/v2020_11_01/_configuration.py | 58 +- .../_data_box_management_client.py | 88 +- .../mgmt/databox/v2020_11_01/_metadata.json | 81 +- .../azure/mgmt/databox/v2020_11_01/_patch.py | 20 + .../azure/mgmt/databox/v2020_11_01/_vendor.py | 27 + .../mgmt/databox/v2020_11_01/_version.py | 2 +- .../mgmt/databox/v2020_11_01/aio/__init__.py | 13 +- .../databox/v2020_11_01/aio/_configuration.py | 55 +- .../aio/_data_box_management_client.py | 77 +- .../mgmt/databox/v2020_11_01/aio/_patch.py | 20 + .../v2020_11_01/aio/operations/__init__.py | 12 +- .../aio/operations/_jobs_operations.py | 1356 ++-- .../v2020_11_01/aio/operations/_operations.py | 125 +- .../v2020_11_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 973 ++- .../databox/v2020_11_01/models/__init__.py | 613 +- .../_data_box_management_client_enums.py | 541 +- .../databox/v2020_11_01/models/_models.py | 3990 ----------- .../databox/v2020_11_01/models/_models_py3.py | 4529 ++++++------ .../mgmt/databox/v2020_11_01/models/_patch.py | 20 + .../v2020_11_01/operations/__init__.py | 12 +- .../operations/_jobs_operations.py | 1675 +++-- .../v2020_11_01/operations/_operations.py | 155 +- .../databox/v2020_11_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1188 +++- .../mgmt/databox/v2021_03_01/__init__.py | 24 + .../databox/v2021_03_01/_configuration.py | 69 + .../_data_box_management_client.py | 102 + .../mgmt/databox/v2021_03_01/_metadata.json | 123 + .../azure/mgmt/databox/v2021_03_01/_patch.py | 20 + .../azure/mgmt/databox/v2021_03_01/_vendor.py | 47 + .../mgmt/databox/v2021_03_01/_version.py | 9 + .../mgmt/databox/v2021_03_01/aio/__init__.py | 21 + .../databox/v2021_03_01/aio/_configuration.py | 66 + .../aio/_data_box_management_client.py | 99 + .../mgmt/databox/v2021_03_01/aio/_patch.py | 20 + .../mgmt/databox/v2021_03_01/aio/_vendor.py | 28 + .../v2021_03_01/aio/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 172 + .../aio/operations/_jobs_operations.py | 1227 ++++ .../v2021_03_01/aio/operations/_operations.py | 127 + .../v2021_03_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 872 +++ .../databox/v2021_03_01/models/__init__.py | 275 + .../_data_box_management_client_enums.py | 333 + .../databox/v2021_03_01/models/_models_py3.py | 4847 +++++++++++++ .../mgmt/databox/v2021_03_01/models/_patch.py | 20 + .../v2021_03_01/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 206 + .../operations/_jobs_operations.py | 1501 ++++ .../v2021_03_01/operations/_operations.py | 147 + .../databox/v2021_03_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1058 +++ .../azure/mgmt/databox/v2021_03_01/py.typed | 1 + .../mgmt/databox/v2021_05_01/__init__.py | 24 + .../databox/v2021_05_01/_configuration.py | 69 + .../_data_box_management_client.py | 102 + .../mgmt/databox/v2021_05_01/_metadata.json | 123 + .../azure/mgmt/databox/v2021_05_01/_patch.py | 20 + .../azure/mgmt/databox/v2021_05_01/_vendor.py | 47 + .../mgmt/databox/v2021_05_01/_version.py | 9 + .../mgmt/databox/v2021_05_01/aio/__init__.py | 21 + .../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 | 172 + .../aio/operations/_jobs_operations.py | 1227 ++++ .../v2021_05_01/aio/operations/_operations.py | 127 + .../v2021_05_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 872 +++ .../databox/v2021_05_01/models/__init__.py | 275 + .../_data_box_management_client_enums.py | 339 + .../databox/v2021_05_01/models/_models_py3.py | 4848 +++++++++++++ .../mgmt/databox/v2021_05_01/models/_patch.py | 20 + .../v2021_05_01/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 206 + .../operations/_jobs_operations.py | 1501 ++++ .../v2021_05_01/operations/_operations.py | 147 + .../databox/v2021_05_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1058 +++ .../azure/mgmt/databox/v2021_05_01/py.typed | 1 + .../databox/v2021_08_01_preview/__init__.py | 24 + .../v2021_08_01_preview/_configuration.py | 69 + .../_data_box_management_client.py | 102 + .../v2021_08_01_preview/_metadata.json | 123 + .../databox/v2021_08_01_preview/_patch.py | 20 + .../databox/v2021_08_01_preview/_vendor.py | 47 + .../databox/v2021_08_01_preview/_version.py | 9 + .../v2021_08_01_preview/aio/__init__.py | 21 + .../v2021_08_01_preview/aio/_configuration.py | 66 + .../aio/_data_box_management_client.py | 99 + .../databox/v2021_08_01_preview/aio/_patch.py | 20 + .../v2021_08_01_preview/aio/_vendor.py | 28 + .../aio/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 173 + .../aio/operations/_jobs_operations.py | 1377 ++++ .../aio/operations/_operations.py | 127 + .../aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 875 +++ .../v2021_08_01_preview/models/__init__.py | 305 + .../_data_box_management_client_enums.py | 438 ++ .../v2021_08_01_preview/models/_models_py3.py | 5818 ++++++++++++++++ .../v2021_08_01_preview/models/_patch.py | 20 + .../operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 207 + .../operations/_jobs_operations.py | 1686 +++++ .../operations/_operations.py | 147 + .../v2021_08_01_preview/operations/_patch.py | 20 + .../operations/_service_operations.py | 1064 +++ .../mgmt/databox/v2021_08_01_preview/py.typed | 1 + .../mgmt/databox/v2021_12_01/__init__.py | 24 + .../databox/v2021_12_01/_configuration.py | 69 + .../_data_box_management_client.py | 102 + .../mgmt/databox/v2021_12_01/_metadata.json | 123 + .../azure/mgmt/databox/v2021_12_01/_patch.py | 20 + .../azure/mgmt/databox/v2021_12_01/_vendor.py | 47 + .../mgmt/databox/v2021_12_01/_version.py | 9 + .../mgmt/databox/v2021_12_01/aio/__init__.py | 21 + .../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 | 172 + .../aio/operations/_jobs_operations.py | 1369 ++++ .../v2021_12_01/aio/operations/_operations.py | 127 + .../v2021_12_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 872 +++ .../databox/v2021_12_01/models/__init__.py | 313 + .../_data_box_management_client_enums.py | 450 ++ .../databox/v2021_12_01/models/_models_py3.py | 6024 ++++++++++++++++ .../mgmt/databox/v2021_12_01/models/_patch.py | 20 + .../v2021_12_01/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 206 + .../operations/_jobs_operations.py | 1676 +++++ .../v2021_12_01/operations/_operations.py | 147 + .../databox/v2021_12_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1058 +++ .../azure/mgmt/databox/v2021_12_01/py.typed | 1 + .../mgmt/databox/v2022_02_01/__init__.py | 24 + .../databox/v2022_02_01/_configuration.py | 69 + .../_data_box_management_client.py | 102 + .../mgmt/databox/v2022_02_01/_metadata.json | 123 + .../azure/mgmt/databox/v2022_02_01/_patch.py | 20 + .../azure/mgmt/databox/v2022_02_01/_vendor.py | 47 + .../mgmt/databox/v2022_02_01/_version.py | 9 + .../mgmt/databox/v2022_02_01/aio/__init__.py | 21 + .../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 | 172 + .../aio/operations/_jobs_operations.py | 1369 ++++ .../v2022_02_01/aio/operations/_operations.py | 127 + .../v2022_02_01/aio/operations/_patch.py | 20 + .../aio/operations/_service_operations.py | 872 +++ .../databox/v2022_02_01/models/__init__.py | 315 + .../_data_box_management_client_enums.py | 450 ++ .../databox/v2022_02_01/models/_models_py3.py | 6084 +++++++++++++++++ .../mgmt/databox/v2022_02_01/models/_patch.py | 20 + .../v2022_02_01/operations/__init__.py | 25 + .../_data_box_management_client_operations.py | 206 + .../operations/_jobs_operations.py | 1676 +++++ .../v2022_02_01/operations/_operations.py | 147 + .../databox/v2022_02_01/operations/_patch.py | 20 + .../operations/_service_operations.py | 1058 +++ .../azure/mgmt/databox/v2022_02_01/py.typed | 1 + 259 files changed, 90272 insertions(+), 29134 deletions(-) create mode 100644 sdk/databox/azure-mgmt-databox/_meta.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_patch.py delete mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py create 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/models/_models.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py create 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/_models.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py create 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/models/_models.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_version.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_version.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py create mode 100644 sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed diff --git a/sdk/databox/azure-mgmt-databox/_meta.json b/sdk/databox/azure-mgmt-databox/_meta.json new file mode 100644 index 000000000000..c4ae2773fe2e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.9.2", + "use": [ + "@autorest/python@6.1.6", + "@autorest/modelerfour@4.24.3" + ], + "commit": "065b070773ed6fa98ede768ad602f4c4d2edf739", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/databox/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.24.3 --version=3.9.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 f2d0b24d67c1..01935d3cb490 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/__init__.py @@ -14,3 +14,7 @@ patch_sdk() except ImportError: pass + +from ._version import VERSION + +__version__ = VERSION 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 5b8f07cf262d..ab875dd4973d 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py @@ -8,14 +8,17 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +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 +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): """Configuration for DataBoxManagementClient. @@ -23,16 +26,16 @@ class DataBoxManagementClientConfiguration(Configuration): 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str + credential: "TokenCredential", + subscription_id: str, **kwargs # type: Any ): # type: (...) -> None @@ -63,4 +66,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 7706fb0d1a02..9382d341f74d 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 @@ -9,12 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import ARMPipelineClient -from msrest import Serializer, Deserializer +from typing import Any, Optional, TYPE_CHECKING +from azure.mgmt.core import ARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin + from ._configuration import DataBoxManagementClientConfiguration +from ._operations_mixin import DataBoxManagementClientOperationsMixin +from ._serialization import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +30,7 @@ def __init__(self, *args, **kwargs): """ pass -class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """The DataBox Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -34,19 +41,20 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): The api-version parameter sets the default API version if the operation group is not described in the profile. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :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 + :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. """ - DEFAULT_API_VERSION = '2020-11-01' + DEFAULT_API_VERSION = '2022-02-01' _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -57,15 +65,13 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + credential: "TokenCredential", + subscription_id: str, + api_version=None, # type: Optional[str] + base_url: str = "https://management.azure.com", + profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - if not base_url: - base_url = 'https://management.azure.com' self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DataBoxManagementClient, self).__init__( @@ -85,6 +91,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 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` """ if api_version == '2018-01-01': from .v2018_01_01 import models @@ -98,6 +109,21 @@ def models(cls, api_version=DEFAULT_API_VERSION): 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 raise ValueError("API version {} is not available".format(api_version)) @property @@ -108,6 +134,11 @@ def jobs(self): * 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` """ api_version = self._get_api_version('jobs') if api_version == '2018-01-01': @@ -118,6 +149,16 @@ def jobs(self): 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 else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -130,6 +171,11 @@ def operations(self): * 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` """ api_version = self._get_api_version('operations') if api_version == '2018-01-01': @@ -140,6 +186,16 @@ def operations(self): 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 else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -152,6 +208,11 @@ def service(self): * 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` """ api_version = self._get_api_version('service') if api_version == '2018-01-01': @@ -162,6 +223,16 @@ def service(self): 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 else: raise ValueError("API version {} does not have operation group 'service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 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 new file mode 100644 index 000000000000..7fac21e4e94f --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 model 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: + """ + 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 + 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._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/_serialization.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py new file mode 100644 index 000000000000..240df16c57f3 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_serialization.py @@ -0,0 +1,2006 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote # type: ignore +import xml.etree.ElementTree as ET + +import isodate + +from typing import Dict, Any, cast, TYPE_CHECKING + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback + +_BOM = codecs.BOM_UTF8.decode(encoding='utf-8') + +if TYPE_CHECKING: + from typing import Optional, Union, AnyStr, IO, Mapping + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r'^(application|text)/([a-z+.]+\+)?json$') + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data, content_type=None): + # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, 'read'): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding='utf-8-sig') + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # 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 + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # 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("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes, headers): + # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if 'content-type' in headers: + content_type = headers['content-type'].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str # type: ignore + unicode_str = str # type: ignore + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + +try: + from datetime import timezone as _FixedOffset +except ImportError: # Python 2.7 + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds()/3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + +try: + from datetime import timezone + TZ_UTC = timezone.utc # type: ignore +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0 + } + + def __init__(self, classes=None): + self.serialize_type = { + 'iso-8601': Serializer.serialize_iso, + 'rfc-1123': Serializer.serialize_rfc, + 'unix-time': Serializer.serialize_unix, + 'duration': Serializer.serialize_duration, + 'date': Serializer.serialize_date, + 'time': Serializer.serialize_time, + 'decimal': Serializer.serialize_decimal, + 'long': Serializer.serialize_long, + 'bytearray': Serializer.serialize_bytearray, + 'base64': Serializer.serialize_base64, + 'object': self.serialize_object, + '[]': self.serialize_iter, + '{}': self.serialize_dict + } + self.dependencies = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data( + target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data( + target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get('readonly', False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == '': + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc['type'], **kwargs) + + + if is_xml_model_serialization: + xml_desc = attr_desc.get('xml', {}) + xml_name = xml_desc.get('name', attr_desc['key']) + xml_prefix = xml_desc.get('prefix', None) + xml_ns = xml_desc.get('ns', None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) + continue + if xml_desc.get("text", False): + serialized.text = new_attr + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if 'name' not in getattr(orig_attr, '_xml_map', {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) + 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) + serialized.append(local_node) + else: # JSON + for k in reversed(keys): + unflattened = {k: new_attr} + new_attr = unflattened + + _new_attr = new_attr + _serialized = serialized + for k in keys: + if k not in _serialized: + _serialized.update(_new_attr) + _new_attr = _new_attr[k] + _serialized = _serialized[k] + except ValueError: + continue + + 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) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type = data_type.strip('[]{}') + internal_data_type = self.dependencies.get(internal_data_type, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback( + SerializationError, "Unable to build a model: "+str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + + if kwargs.get('skip_quote') is True: + output = str(output) + else: + output = quote(str(output), safe='') + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # 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)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + if kwargs.get('skip_quote') is True: + output = str(output) + else: + output = quote(str(output), safe='') + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ['[str]']: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == 'bool': + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type]( + data, data_type[1:-1], **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) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == 'str': + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + 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'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ['' if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if 'xml' in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get('xml', {}) + xml_name = xml_desc.get('name') + if not xml_name: + xml_name = serialization_ctxt['key'] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node( + xml_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node( + node_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data( + value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if 'xml' in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt['xml'] + xml_name = xml_desc['name'] + + final_result = _create_xml_node( + xml_name, + xml_desc.get('prefix', None), + xml_desc.get('ns', None) + ) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + 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: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object( + value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object( + obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) + return result + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode('ascii') + return encoded.strip('=').replace('+', '-').replace('/', '_') + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], utc.tm_mday, + Serializer.months[utc.tm_mon], utc.tm_year, + utc.tm_hour, utc.tm_min, utc.tm_sec) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6,'0').rstrip('0').ljust(3, '0') + if microseconds: + microseconds = '.'+microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, + utc.tm_hour, utc.tm_min, utc.tm_sec) + return date + microseconds + 'Z' + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc['key'] + working_data = data + + while '.' in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, 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:]) + + return working_data.get(key) + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc['key'] + working_data = data + + while '.' in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_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:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + """ + key = attr_desc['key'] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc['key'] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get('name', internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get('xml', {}) + xml_name = xml_desc.get('name', attr_desc['key']) + + # Look for a children + is_iter_type = attr_desc['type'].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get('ns', internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or 'name' not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and 'name' in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + )) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: 'str', int: 'int', bool: 'bool', float: 'float'} + + 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=None): + self.deserialize_type = { + 'iso-8601': Deserializer.deserialize_iso, + 'rfc-1123': Deserializer.deserialize_rfc, + 'unix-time': Deserializer.deserialize_unix, + 'duration': Deserializer.deserialize_duration, + 'date': Deserializer.deserialize_date, + 'time': Deserializer.deserialize_time, + 'decimal': Deserializer.deserialize_decimal, + 'long': Deserializer.deserialize_long, + 'bytearray': Deserializer.deserialize_bytearray, + 'base64': Deserializer.deserialize_base64, + 'object': self.deserialize_object, + '[]': self.deserialize_iter, + '{}': self.deserialize_dict + } + self.deserialize_expected_types = { + 'duration': (isodate.Duration, datetime.timedelta), + 'iso-8601': (datetime.datetime) + } + self.dependencies = 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 + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, '_validation', {}).items() + if config.get('constant')] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig['type'] + internal_data_type = local_type.strip('[]{}') + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr( + data, + attr, + self._deserialize(local_type, value) + ) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == '': + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip('[]{}') + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ("Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" ) + _LOGGER.warning( + msg, + found_value, + key_extractor, + attr + ) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc['type']) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != '': + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = {_decode_attribute_map_key(_FLATTEN.split(desc['key'])[0]) + for desc in attribute_map.values() if desc['key'] != ''} + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", + exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + #Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics( + raw_data.text(), + raw_data.headers + ) + + # Assume this enough to recognize requests.Response without importing it. + 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'): + return RawDeserializer.deserialize_from_text(raw_data, content_type) + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, '_subtype_map', {}) + try: + readonly = [k for k, v in response._validation.items() + if v.get('readonly')] + const = [k for k, v in response._validation.items() + if v.get('constant')] + kwargs = {k: v for k, v in attrs.items() + if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format( + kwargs, response) + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_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) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format( + iter_type, + type(attr) + )) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x['key']: self.deserialize_data(x['value'], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, 'str') + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object( + value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object( + obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return '' + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == 'bool': + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ['true', '1']: + return True + elif attr.lower() in ['false', '0']: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == 'str': + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + 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: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = '=' * (3 - (len(attr) + 3) % 4) + attr = attr + padding + encoded = attr.replace('-', '+').replace('_', '/') + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except(ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + 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) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) + date_obj = datetime.datetime( + *parsed_date[:6], + tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0)/60)) + ) + if not date_obj.tzinfo: + 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) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split('.') + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except(ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) + try: + 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) + else: + return date_obj 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 71fd4699f32f..b0a8c5910ca3 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 @@ -8,14 +8,17 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +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 +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): """Configuration for DataBoxManagementClient. @@ -23,16 +26,16 @@ class DataBoxManagementClientConfiguration(Configuration): 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. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str """ def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str + credential: "AsyncTokenCredential", + subscription_id: str, **kwargs # type: Any ) -> None: if credential is None: @@ -61,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 3d3baff15744..200d54f63be5 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 @@ -9,12 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Serializer, Deserializer +from typing import Any, Optional, TYPE_CHECKING +from azure.mgmt.core import AsyncARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin + +from .._serialization import Deserializer, Serializer from ._configuration import DataBoxManagementClientConfiguration +from ._operations_mixin import DataBoxManagementClientOperationsMixin + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +30,7 @@ def __init__(self, *args, **kwargs): """ pass -class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """The DataBox Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -34,19 +41,20 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): The api-version parameter sets the default API version if the operation group is not described in the profile. - :param credential: Credential needed for the client to connect to Azure. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :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 + :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. """ - DEFAULT_API_VERSION = '2020-11-01' + DEFAULT_API_VERSION = '2022-02-01' _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -57,15 +65,13 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + credential: "AsyncTokenCredential", + subscription_id: str, + api_version: Optional[str] = None, + base_url: str = "https://management.azure.com", + profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DataBoxManagementClient, self).__init__( @@ -85,6 +91,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 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` """ if api_version == '2018-01-01': from ..v2018_01_01 import models @@ -98,6 +109,21 @@ def models(cls, api_version=DEFAULT_API_VERSION): 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 raise ValueError("API version {} is not available".format(api_version)) @property @@ -108,6 +134,11 @@ def jobs(self): * 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` """ api_version = self._get_api_version('jobs') if api_version == '2018-01-01': @@ -118,6 +149,16 @@ def jobs(self): 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 else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -130,6 +171,11 @@ def operations(self): * 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` """ api_version = self._get_api_version('operations') if api_version == '2018-01-01': @@ -140,6 +186,16 @@ def operations(self): 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 else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -152,6 +208,11 @@ def service(self): * 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` """ api_version = self._get_api_version('service') if api_version == '2018-01-01': @@ -162,6 +223,16 @@ def service(self): 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 else: raise ValueError("API version {} does not have operation group 'service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 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 new file mode 100644 index 000000000000..2a7c54df0a0e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 model 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: + """ + 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 + 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._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/models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py index 3194fab613a3..0b7b50d44ade 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2020_11_01.models import * +from .v2022_02_01.models import * 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 index ae972ed54f84..c3f328be41df 100644 --- 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 @@ -10,10 +10,15 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['DataBoxManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import except ImportError: - pass + _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 index 0f732507656b..229cb17f6aee 100644 --- 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 @@ -6,66 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :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, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2018-01-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index e696cb06a780..1b114bc3bd03 100644 --- 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 @@ -6,65 +6,85 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import 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 typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2018_01_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2018_01_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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 + """ - 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) + 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): # type: () -> None 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 index 2f491dd3621f..0bd3ba64d501 100644 --- 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 @@ -5,59 +5,100 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "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, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "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, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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": "None", - "async_imports": "None" + } } \ No newline at end of file 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/v2018_01_01/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2018_01_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py new file mode 100644 index 000000000000..9aad73fc743e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = 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 index eae7c95b6fbd..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" 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 index bb6b75a72db8..e9ac07d95558 100644 --- 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 @@ -7,4 +7,15 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # 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 index 9eb0b463e8f5..03640489e98d 100644 --- 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 @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,49 +19,48 @@ from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :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. + :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: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2018-01-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index b192ff7cd771..ce0afd0bcfe8 100644 --- 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 @@ -6,62 +6,85 @@ # 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 azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import 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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2018_01_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2018_01_01.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. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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 + """ - 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) + 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() 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/v2018_01_01/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2018_01_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/__init__.py index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index 0a54ebde341c..52d4774957ab 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,94 +6,119 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """JobsOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,7 +127,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -110,65 +138,69 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -177,7 +209,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -186,115 +220,121 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + + @distributed_trace_async async def get( - self, - resource_group_name: str, - job_name: str, - expand: Optional[str] = None, - **kwargs - ) -> "_models.JobResource": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -303,118 +343,202 @@ async def _create_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_create( self, resource_group_name: str, job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - async def _delete_initial( - self, - resource_group_name: str, - job_name: str, - **kwargs + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202, 204]: @@ -424,115 +548,122 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - async def begin_delete( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncLROPoller[None]: + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _update_initial( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], if_match: Optional[str] = None, - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + **kwargs: Any + ) -> Optional[_models.JobResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -541,209 +672,455 @@ async def _update_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: _models.JobResourceUpdateParameter, if_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + *, + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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: "_models.ShipmentPickUpRequest", - **kwargs - ) -> "_models.ShipmentPickUpResponse": + shipment_pick_up_request: Union[_models.ShipmentPickUpRequest, IO], + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: """Book shipment pick up. - :param resource_group_name: The Resource Group Name. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :param shipment_pick_up_request: Details of shipment pick up request. Is either a model 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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ShipmentPickUpResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - async def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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: "_models.CancellationReason", - **kwargs + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any ) -> None: """CancelJob. - :param resource_group_name: The Resource Group Name. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: @@ -753,61 +1130,69 @@ async def cancel( if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -816,7 +1201,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -825,7 +1212,6 @@ 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index f0dde5272cb2..9a7af19bb5b4 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,82 +6,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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') +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: - """Operations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationList"]: + @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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,7 +109,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,7 +120,6 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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/v2018_01_01/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/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 index 10e5b276c56f..92ef862e6808 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,101 +6,170 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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') +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ServiceOperations: - """ServiceOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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", - **kwargs - ) -> AsyncIterable["_models.AvailableSkusResult"]: + 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. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,7 +178,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -117,69 +189,124 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_available_skus.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload async def validate_address( self, location: str, - validate_address: "_models.ValidateAddress", - **kwargs - ) -> "_models.AddressValidationOutput": + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore 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 index b69af98fbdea..e06ae09c65d3 100644 --- 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 @@ -6,197 +6,144 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DestinationAccountDetails # type: ignore - from ._models import DestinationManagedDiskDetails # type: ignore - from ._models import DestinationStorageAccountDetails # type: ignore - from ._models import DestinationToServiceLocationMap # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import Error # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobErrorDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import Resource # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore +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, - AddressType, - AddressValidationStatus, - ClassDiscriminator, - CopyStatus, - DataDestinationType, - NotificationStageName, - ShareDestinationFormatType, - SkuDisabledReason, - SkuName, - StageName, - StageStatus, -) +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 * # type: ignore # 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', + "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 index d7085516d562..0dad51f1a498 100644 --- 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 @@ -6,139 +6,188 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. - -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The address validation status. - """ - - VALID = "Valid" #: Address provided is valid. - INVALID = "Invalid" #: Address provided is invalid or not supported. - AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates the type of job details. - """ - - DATA_BOX = "DataBox" #: DataBox orders. - DATA_BOX_DISK = "DataBoxDisk" #: DataBoxDisk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataBoxHeavy orders. - -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Status of the copy - """ - - NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. - IN_PROGRESS = "InProgress" #: Data copy is in progress. - COMPLETED = "Completed" #: Data copy completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. - FAILED = "Failed" #: Data copy failed. No data was copied. - NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. - -class DataDestinationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Data Destination Type. - """ - - UNKNOWN_TYPE = "UnknownType" #: Unknown type. - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. - -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - - DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. - DISPATCHED = "Dispatched" #: Notification at device dispatched stage. - DELIVERED = "Delivered" #: Notification at device delivered stage. - PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. - AT_AZURE_DC = "AtAzureDC" #: Notification at device received at azure datacenter stage. - DATA_COPY = "DataCopy" #: Notification at data copy started stage. - -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the share. - """ - - UNKNOWN_TYPE = "UnknownType" #: Unknown format. - HCS = "HCS" #: StorSimple data format. - BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. - PAGE_BLOB = "PageBlob" #: Azure storage page blob format. - AZURE_FILE = "AzureFile" #: Azure storage file format. - MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. - -class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the Sku is disabled. - """ - - NONE = "None" #: SKU is not disabled. - COUNTRY = "Country" #: SKU is not available in the requested country. - REGION = "Region" #: SKU is not available to push data to the requested Azure region. - FEATURE = "Feature" #: Required features are not enabled for the SKU. - OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: DataBox. - DATA_BOX_DISK = "DataBoxDisk" #: DataBoxDisk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataBoxHeavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage which is in progress. - """ - - DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. - DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. - DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. - DELIVERED = "Delivered" #: Device has been delivered to the user of the order. - PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to azure datacenter. - AT_AZURE_DC = "AtAzureDC" #: Device has been received at azure datacenter from the user. - DATA_COPY = "DataCopy" #: Data copy from the device at azure datacenter. - COMPLETED = "Completed" #: Order has completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. - CANCELLED = "Cancelled" #: Order has been cancelled. - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at azure datacenter. - ABORTED = "Aborted" #: Order has been aborted. - -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the job stage. - """ - - NONE = "None" #: No status available yet. - IN_PROGRESS = "InProgress" #: Stage is in progress. - SUCCEEDED = "Succeeded" #: Stage has succeeded. - FAILED = "Failed" #: Stage has failed. - CANCELLED = "Cancelled" #: Stage has been cancelled. - CANCELLING = "Cancelling" #: Stage is cancelling. - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AccessProtocol.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: DataBox orders. + DATA_BOX = "DataBox" + #: DataBoxDisk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: DataBoxHeavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + + +class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Data Destination Type.""" + + #: Unknown type. + UNKNOWN_TYPE = "UnknownType" + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: StorSimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: DataBox. + DATA_BOX = "DataBox" + #: DataBoxDisk. + DATA_BOX_DISK = "DataBoxDisk" + #: DataBoxHeavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py deleted file mode 100644 index 08c25212fb89..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py +++ /dev/null @@ -1,2212 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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.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 - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.account_connection_string = None - self.share_credential_details = None - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_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 - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_status = None - self.alternate_addresses = None - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.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, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _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, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'readonly': 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 - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.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: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long - """ - - _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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__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. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.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': {'readonly': 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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - 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. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'readonly': 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 - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.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: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned". - :vartype status: str or ~azure.mgmt.databox.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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """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. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_tera_bytes = kwargs.get('expected_data_size_in_tera_bytes', None) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs['shipping_address'] - self.delivery_package = None - self.return_package = None - self.destination_account_details = kwargs['destination_account_details'] - self.error_details = None - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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 - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type 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, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'job_secrets_type': {'readonly': 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 - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'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'}, - 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, - 'pass_key': {'key': 'passKey', 'type': 'str'}, - 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -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. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.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': {'readonly': 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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """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. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.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, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - 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. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar cabinet_pod_secrets: Contains the list of secret objects for a DataBoxHeavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] - """ - - _validation = { - 'job_secrets_type': {'readonly': 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 - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.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.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """DataBox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.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, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - - -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. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - 'job_secrets_type': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__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(msrest.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. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type 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, - **kwargs - ): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.data_destination_type = None # type: Optional[str] - self.account_id = kwargs.get('account_id', None) - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _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, - **kwargs - ): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.data_destination_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['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. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type 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, - **kwargs - ): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.data_destination_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class DestinationToServiceLocationMap(msrest.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 - ): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class Error(msrest.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 - ): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None - - -class JobErrorDetails(msrest.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 - ): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - """ - - _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, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted". - :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.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :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, - **kwargs - ): - super(JobResource, self).__init__(**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 = kwargs.get('details', None) - self.cancellation_reason = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) - - -class JobStages(msrest.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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted". - :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. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.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 - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - self.error_details = None - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type 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, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :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 - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type 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, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: - :type preferred_data_center_region: list[str] - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _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, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.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 - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type 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, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuCapacity(msrest.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 - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _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 - ): - super(SkuInformation, self).__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(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - """ - - _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - - -class ValidateAddress(msrest.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. - - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _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, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] 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 index 250d9d2dfe7d..42043a34b502 100644 --- 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 @@ -1,4 +1,5 @@ # 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. @@ -7,14 +8,16 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Dict, List, Optional, TYPE_CHECKING, Union -import msrest.serialization +from ... import _serialization -from ._data_box_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models -class AccountCredentialDetails(msrest.serialization.Model): +class AccountCredentialDetails(_serialization.Model): """Credential details of the account. Variables are only populated by the server, and will be ignored when sending a request. @@ -25,63 +28,61 @@ class AccountCredentialDetails(msrest.serialization.Model): as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :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}, + "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]'}, + "account_name": {"key": "accountName", "type": "str"}, + "account_connection_string": {"key": "accountConnectionString", "type": "str"}, + "share_credential_details": {"key": "shareCredentialDetails", "type": "[ShareCredentialDetails]"}, } - def __init__( - self, - **kwargs - ): - super(AccountCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.account_name = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(msrest.serialization.Model): +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. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :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.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2018_01_01.models.ShippingAddress] """ _validation = { - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, + "validation_status": {"readonly": True}, + "alternate_addresses": {"readonly": True}, } _attribute_map = { - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, + "validation_status": {"key": "properties.validationStatus", "type": "str"}, + "alternate_addresses": {"key": "properties.alternateAddresses", "type": "[ShippingAddress]"}, } - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(msrest.serialization.Model): +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. @@ -93,25 +94,23 @@ class ApplianceNetworkConfiguration(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, + "name": {"readonly": True}, + "mac_address": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "mac_address": {"key": "macAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(msrest.serialization.Model): +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. @@ -125,165 +124,169 @@ class ArmBaseObject(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, + "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'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(msrest.serialization.Model): +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: Required. Type of the transfer. Default value: "ImportToAzure". + :ivar transfer_type: Type of the transfer. Required. Default value is "ImportToAzure". :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + 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}, + "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": {"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, "SkuName"]]] = None, - **kwargs + self, *, country: str, location: str, sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, **kwargs ): - super(AvailableSkuRequest, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class AvailableSkusResult(_serialization.Model): """The available skus operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SkuInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class CancellationReason(_serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs): + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason -class ContactDetails(msrest.serialization.Model): +class ContactDetails(_serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :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}, + "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]'}, + "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__( @@ -294,10 +297,25 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - notification_preference: Optional[List["NotificationPreference"]] = None, + notification_preference: Optional[List["_models.NotificationPreference"]] = None, **kwargs ): - super(ContactDetails, self).__init__(**kwargs) + """ + :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 @@ -306,40 +324,43 @@ def __init__( self.notification_preference = notification_preference -class CopyLogDetails(msrest.serialization.Model): +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. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails - Variables are only 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.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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': {'readonly': True}, + "copy_log_details_type": {"required": True}, } _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, } _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} + "copy_log_details_type": { + "DataBox": "DataBoxAccountCopyLogDetails", + "DataBoxDisk": "DataBoxDiskCopyLogDetails", + "DataBoxHeavy": "DataBoxHeavyAccountCopyLogDetails", + } } - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(msrest.serialization.Model): +class CopyProgress(_serialization.Model): """Copy progress. Variables are only populated by the server, and will be ignored when sending a request. @@ -349,38 +370,36 @@ class CopyProgress(msrest.serialization.Model): :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long + :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: long + :vartype total_bytes_to_process: int :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long + :vartype files_processed: int :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long + :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}, + "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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, + "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 - ): - super(CopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.storage_account_name = None self.account_id = None self.bytes_sent_to_cloud = None @@ -394,9 +413,12 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + 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. @@ -404,23 +426,21 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str self.account_name = None self.copy_log_link = None @@ -430,9 +450,12 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + 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. @@ -442,31 +465,29 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None -class DataBoxDiskCopyProgress(msrest.serialization.Model): +class DataBoxDiskCopyProgress(_serialization.Model): """DataBox Disk Copy Progress. Variables are only populated by the server, and will be ignored when sending a request. @@ -474,73 +495,72 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long + :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. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :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}, + "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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, + "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 - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.serial_number = None self.bytes_copied = None self.percent_complete = None self.status = None -class JobDetails(msrest.serialization.Model): +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. + 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. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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. @@ -548,50 +568,68 @@ class JobDetails(msrest.serialization.Model): """ _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, + "job_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'}, + "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'} + "job_details_type": { + "DataBox": "DataBoxJobDetails", + "DataBoxDisk": "DataBoxDiskJobDetails", + "DataBoxHeavy": "DataBoxHeavyJobDetails", + } } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], + 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["Preferences"] = None, + preferences: Optional["_models.Preferences"] = None, **kwargs ): - super(JobDetails, self).__init__(**kwargs) + """ + :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 @@ -607,140 +645,170 @@ def __init__( self.chain_of_custody_sas_key = None -class DataBoxDiskJobDetails(JobDetails): +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. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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 - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :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. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :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] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :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}, + "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'}, + "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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], + 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["Preferences"] = None, + preferences: Optional["_models.Preferences"] = None, preferred_disks: Optional[Dict[str, int]] = None, passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__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 = 'DataBoxDisk' # type: str + """ + :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 = "DataBoxDisk" # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey -class JobSecrets(msrest.serialization.Model): +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. + 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.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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': {'readonly': True}, + "job_secrets_type": {"required": True}, } _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, } _subtype_map = { - 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} + "job_secrets_type": { + "DataBox": "DataboxJobSecrets", + "DataBoxDisk": "DataBoxDiskJobSecrets", + "DataBoxHeavy": "DataBoxHeavyJobSecrets", + } } - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] @@ -749,11 +817,13 @@ class DataBoxDiskJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + 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.models.DiskSecret] + :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. @@ -761,25 +831,23 @@ class DataBoxDiskJobSecrets(JobSecrets): """ _validation = { - 'job_secrets_type': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None @@ -790,9 +858,12 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + 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. @@ -800,110 +871,130 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, + "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]'}, + "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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str self.account_name = None self.copy_log_link = None -class DataBoxHeavyJobDetails(JobDetails): +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. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.CopyProgress] + :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}, + "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]'}, + "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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], + 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["Preferences"] = None, + preferences: Optional["_models.Preferences"] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__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 = 'DataBoxHeavy' # type: str + """ + :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 = "DataBoxHeavy" # type: str self.copy_progress = None @@ -912,33 +1003,33 @@ class DataBoxHeavyJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + 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.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxHeavySecret] """ _validation = { - 'job_secrets_type': {'readonly': True}, - 'cabinet_pod_secrets': {'readonly': True}, + "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]'}, + "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, + "cabinet_pod_secrets": {"key": "cabinetPodSecrets", "type": "[DataBoxHeavySecret]"}, } - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str self.cabinet_pod_secrets = None -class DataBoxHeavySecret(msrest.serialization.Model): +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. @@ -948,35 +1039,35 @@ class DataBoxHeavySecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -984,125 +1075,146 @@ def __init__( self.account_credential_details = None -class DataBoxJobDetails(JobDetails): +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. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.CopyProgress] + :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}, + "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]'}, + "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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], + 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["Preferences"] = None, + preferences: Optional["_models.Preferences"] = None, **kwargs ): - super(DataBoxJobDetails, self).__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 = 'DataBox' # type: str + """ + :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 = "DataBox" # type: str self.copy_progress = None 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.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :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': {'readonly': True}, + "job_secrets_type": {"required": True}, } _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, + "job_secrets_type": {"key": "jobSecretsType", "type": "str"}, + "pod_secrets": {"key": "podSecrets", "type": "[DataBoxSecret]"}, } - def __init__( - self, - *, - pod_secrets: Optional[List["DataBoxSecret"]] = None, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str + def __init__(self, *, pod_secrets: Optional[List["_models.DataBoxSecret"]] = None, **kwargs): + """ + :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 = "DataBox" # type: str self.pod_secrets = pod_secrets -class DataBoxSecret(msrest.serialization.Model): +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. @@ -1112,35 +1224,35 @@ class DataBoxSecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1148,41 +1260,44 @@ def __init__( self.account_credential_details = None -class DestinationAccountDetails(msrest.serialization.Model): +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. + 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. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str + :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}, + "data_destination_type": {"required": True}, } _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, + "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 - ): - super(DestinationAccountDetails, self).__init__(**kwargs) + "data_destination_type": { + "ManagedDisk": "DestinationManagedDiskDetails", + "StorageAccount": "DestinationStorageAccountDetails", + } + } + + def __init__(self, *, account_id: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.account_id = account_id @@ -1192,42 +1307,48 @@ class DestinationManagedDiskDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str + :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}, + "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'}, + "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 + self, *, resource_group_id: str, staging_storage_account_id: str, account_id: Optional[str] = None, **kwargs ): - super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, **kwargs) - self.data_destination_type = 'ManagedDisk' # type: str + """ + :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 = "ManagedDisk" # type: str self.resource_group_id = resource_group_id self.staging_storage_account_id = staging_storage_account_id @@ -1237,39 +1358,40 @@ class DestinationStorageAccountDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :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}, + "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 - ): - super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, **kwargs) - self.data_destination_type = 'StorageAccount' # type: str + "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): + """ + :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 = "StorageAccount" # type: str self.storage_account_id = storage_account_id -class DestinationToServiceLocationMap(msrest.serialization.Model): +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. @@ -1281,25 +1403,23 @@ class DestinationToServiceLocationMap(msrest.serialization.Model): """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + "destination_location": {"readonly": True}, + "service_location": {"readonly": True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + "destination_location": {"key": "destinationLocation", "type": "str"}, + "service_location": {"key": "serviceLocation", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.destination_location = None self.service_location = None -class DiskSecret(msrest.serialization.Model): +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. @@ -1312,25 +1432,23 @@ class DiskSecret(msrest.serialization.Model): """ _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, + "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'}, + "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, + "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(msrest.serialization.Model): +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. @@ -1342,25 +1460,23 @@ class Error(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.code = None self.message = None -class JobErrorDetails(msrest.serialization.Model): +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. @@ -1376,89 +1492,92 @@ class JobErrorDetails(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, + "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'}, + "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 - ): - super(JobErrorDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.error_message = None self.error_code = None self.recommended_action = None self.exception_message = None -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :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}, + "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: "Sku", - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(Resource, self).__init__(**kwargs) + "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): + """ + :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): +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. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :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. @@ -1471,63 +1590,77 @@ class JobResource(Resource): :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. Possible values include: "DeviceOrdered", + :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". - :vartype status: str or ~azure.mgmt.databox.models.StageName + "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.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~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}, + "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'}, + "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: "Sku", + sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, - details: Optional["JobDetails"] = None, + details: Optional["_models.JobDetails"] = None, **kwargs ): - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + """ + :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 @@ -1541,110 +1674,124 @@ def __init__( self.cancellation_reason = None -class JobResourceList(msrest.serialization.Model): +class JobResourceList(_serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["JobResource"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs ): - super(JobResourceList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class JobResourceUpdateParameter(_serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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]'}, + "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["UpdateJobDetails"] = None, - destination_account_details: Optional[List["DestinationAccountDetails"]] = None, + details: Optional["_models.UpdateJobDetails"] = None, + destination_account_details: Optional[List["_models.DestinationAccountDetails"]] = None, **kwargs ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + :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". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + "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. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. 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: object + :vartype job_stage_details: JSON :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :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}, + "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]'}, + "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 - ): - super(JobStages, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None @@ -1653,41 +1800,44 @@ def __init__( self.error_details = None -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :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}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool = True, **kwargs ): - super(NotificationPreference, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Operation(_serialization.Model): """Operation entity. Variables are only populated by the server, and will be ignored when sending a request. @@ -1696,56 +1846,54 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2018_01_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :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}, + "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'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "properties": {"key": "properties", "type": "object"}, + "origin": {"key": "origin", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :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'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1757,45 +1905,54 @@ def __init__( description: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class OperationList(_serialization.Model): """Operation Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class PackageShippingDetails(_serialization.Model): """Shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -1809,87 +1966,83 @@ class PackageShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "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'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: - :type preferred_data_center_region: list[str] + :ivar preferred_data_center_region: + :vartype preferred_data_center_region: list[str] """ _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, + "preferred_data_center_region": {"key": "preferredDataCenterRegion", "type": "[str]"}, } - def __init__( - self, - *, - preferred_data_center_region: Optional[List[str]] = None, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) + def __init__(self, *, preferred_data_center_region: Optional[List[str]] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. 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.models.AccessProtocol] + :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}, + "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]'}, + "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 - ): - super(ShareCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.share_name = None self.share_type = None self.user_name = None @@ -1897,48 +2050,51 @@ def __init__( self.supported_access_protocols = None -class ShipmentPickUpRequest(msrest.serialization.Model): +class ShipmentPickUpRequest(_serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :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}, + "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 - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) + "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): + """ + :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(msrest.serialization.Model): +class ShipmentPickUpResponse(_serialization.Model): """Shipment pick up response. Variables are only populated by the server, and will be ignored when sending a request. @@ -1951,69 +2107,66 @@ class ShipmentPickUpResponse(msrest.serialization.Model): """ _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, + "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'}, + "confirmation_number": {"key": "confirmationNumber", "type": "str"}, + "ready_by_time": {"key": "readyByTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(msrest.serialization.Model): +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. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :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}, + "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'}, + "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__( @@ -2028,10 +2181,33 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Union[str, "_models.AddressType"] = "None", **kwargs ): - super(ShippingAddress, self).__init__(**kwargs) + """ + :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 @@ -2044,45 +2220,54 @@ def __init__( self.address_type = address_type -class Sku(msrest.serialization.Model): +class Sku(_serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :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}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "family": {"key": "family", "type": "str"}, } def __init__( self, *, - name: Union[str, "SkuName"], + name: Union[str, "_models.SkuName"], display_name: Optional[str] = None, family: Optional[str] = None, **kwargs ): - super(Sku, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class SkuCapacity(_serialization.Model): """Capacity of the sku. Variables are only populated by the server, and will be ignored when sending a request. @@ -2094,25 +2279,23 @@ class SkuCapacity(msrest.serialization.Model): """ _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, + "usable": {"readonly": True}, + "maximum": {"readonly": True}, } _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, + "usable": {"key": "usable", "type": "str"}, + "maximum": {"key": "maximum", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(msrest.serialization.Model): +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. @@ -2124,45 +2307,43 @@ class SkuCost(msrest.serialization.Model): """ _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, + "meter_id": {"readonly": True}, + "meter_type": {"readonly": True}, } _attribute_map = { - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_type': {'key': 'meterType', 'type': 'str'}, + "meter_id": {"key": "meterId", "type": "str"}, + "meter_type": {"key": "meterType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.meter_id = None self.meter_type = None -class SkuInformation(msrest.serialization.Model): +class SkuInformation(_serialization.Model): """Information of the sku. Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :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.models.DestinationToServiceLocationMap] + list[~azure.mgmt.databox.v2018_01_01.models.DestinationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2018_01_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :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. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. 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. @@ -2170,34 +2351,35 @@ class SkuInformation(msrest.serialization.Model): """ _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}, + "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 - ): - super(SkuInformation, self).__init__(**kwargs) + "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): + """ """ + super().__init__(**kwargs) self.sku = None self.enabled = None self.destination_to_service_location_map = None @@ -2209,7 +2391,7 @@ def __init__( self.required_feature = None -class UnencryptedCredentials(msrest.serialization.Model): +class UnencryptedCredentials(_serialization.Model): """Unencrypted credentials for accessing device. Variables are only populated by the server, and will be ignored when sending a request. @@ -2217,109 +2399,122 @@ class UnencryptedCredentials(msrest.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.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2018_01_01.models.JobSecrets """ _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, + "job_name": {"readonly": True}, + "job_secrets": {"readonly": True}, } _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, + "job_name": {"key": "jobName", "type": "str"}, + "job_secrets": {"key": "jobSecrets", "type": "JobSecrets"}, } - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_name = None self.job_secrets = None -class UnencryptedCredentialsList(msrest.serialization.Model): +class UnencryptedCredentialsList(_serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[UnencryptedCredentials]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["UnencryptedCredentials"]] = None, + value: Optional[List["_models.UnencryptedCredentials"]] = None, next_link: Optional[str] = None, **kwargs ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class UpdateJobDetails(_serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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'}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, } def __init__( self, *, - contact_details: Optional["ContactDetails"] = None, - shipping_address: Optional["ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, **kwargs ): - super(UpdateJobDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :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}, + "shipping_address": {"required": True}, + "device_type": {"required": True}, } _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "device_type": {"key": "deviceType", "type": "str"}, } def __init__( - self, - *, - shipping_address: "ShippingAddress", - device_type: Union[str, "SkuName"], - **kwargs + self, *, shipping_address: "_models.ShippingAddress", device_type: Union[str, "_models.SkuName"], **kwargs ): - super(ValidateAddress, self).__init__(**kwargs) + """ + :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/models/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2018_01_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/__init__.py index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index 680eb7dbdbdd..ce163960413e 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,99 +6,386 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + # 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 = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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 {}) -class JobsOperations(object): - """JobsOperations operations. + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + +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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + # 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,7 +394,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -115,66 +405,68 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -183,7 +475,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,117 +486,121 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + return ItemPaged(get_next, extract_data) + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + + @distributed_trace def get( - self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _create_initial( - self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -311,120 +609,202 @@ def _create_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._create_initial( + raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - def _delete_initial( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202, 204]: @@ -434,117 +814,122 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - def begin_delete( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -553,212 +938,455 @@ def _update_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._update_initial( + raw_result = self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + @overload def book_shipment_pick_up( self, - resource_group_name, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: @@ -768,62 +1396,69 @@ def cancel( if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -832,7 +1467,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -841,7 +1478,6 @@ 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index c67bbf185f94..45768ac6bb86 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,87 +6,122 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 + -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + accept = _headers.pop("Accept", "application/json") -class Operations(object): - """Operations operations. + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + 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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,7 +130,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,7 +141,6 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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/v2018_01_01/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2018_01_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py index 1bd91217c489..1bd2e7742b78 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,106 +6,230 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 HttpRequest, HttpResponse +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 -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False -class ServiceOperations(object): - """ServiceOperations operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +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 {}) - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + 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. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,7 +238,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -122,70 +249,124 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + return ItemPaged(get_next, extract_data) + list_available_skus.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + + @overload def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore 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 index ae972ed54f84..c3f328be41df 100644 --- 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 @@ -10,10 +10,15 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['DataBoxManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import except ImportError: - pass + _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 index ff9318047975..76a7043ce34b 100644 --- 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 @@ -6,66 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :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, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2019-09-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2019-09-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index e696cb06a780..60650ee0b6c4 100644 --- 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 @@ -6,65 +6,85 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import 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 typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2019_09_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2019_09_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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 + """ - 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) + 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): # type: () -> None 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 index 10c0c55446ae..d5161714913a 100644 --- 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 @@ -5,59 +5,100 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "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, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "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, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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": "None", - "async_imports": "None" + } } \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..9aad73fc743e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = 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 index eae7c95b6fbd..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" 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 index bb6b75a72db8..e9ac07d95558 100644 --- 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 @@ -7,4 +7,15 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # 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 index bd2655860674..a1f74425413f 100644 --- 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 @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,49 +19,48 @@ from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :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. + :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: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2019-09-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2019-09-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index b192ff7cd771..23473288701f 100644 --- 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 @@ -6,62 +6,85 @@ # 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 azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import 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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2019_09_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2019_09_01.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. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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 + """ - 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) + 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() 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index f01a52d0a1a9..98efd489202b 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,94 +6,119 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """JobsOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,7 +127,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -110,65 +138,69 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -177,7 +209,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -186,115 +220,121 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + + @distributed_trace_async async def get( - self, - resource_group_name: str, - job_name: str, - expand: Optional[str] = None, - **kwargs - ) -> "_models.JobResource": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -303,120 +343,202 @@ async def _create_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_create( self, resource_group_name: str, job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - async def _delete_initial( - self, - resource_group_name: str, - job_name: str, - **kwargs + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202, 204]: @@ -426,115 +548,122 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - async def begin_delete( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncLROPoller[None]: + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _update_initial( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], if_match: Optional[str] = None, - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + **kwargs: Any + ) -> Optional[_models.JobResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -543,211 +672,455 @@ async def _update_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: _models.JobResourceUpdateParameter, if_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + *, + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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: "_models.ShipmentPickUpRequest", - **kwargs - ) -> "_models.ShipmentPickUpResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - async def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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: "_models.CancellationReason", - **kwargs + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any ) -> None: """CancelJob. - :param resource_group_name: The Resource Group Name. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: @@ -757,61 +1130,69 @@ async def cancel( if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -820,7 +1201,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -829,7 +1212,6 @@ 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index bd99838be8c3..d02ef285db98 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,82 +6,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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') +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: - """Operations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationList"]: + @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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,7 +109,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,7 +120,6 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index a07ce55b508d..55bb1c94a770 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,101 +6,177 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """ServiceOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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", - **kwargs - ) -> AsyncIterable["_models.AvailableSkusResult"]: + 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. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,7 +185,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -117,75 +196,148 @@ async def get_next(next_link=None): return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_available_skus.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _models.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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: "_models.AvailableSkuRequest", - **kwargs - ) -> AsyncIterable["_models.AvailableSkusResult"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -194,7 +346,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,260 +357,503 @@ async def get_next(next_link=None): 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload async def validate_address( self, location: str, - validate_address: "_models.ValidateAddress", - **kwargs - ) -> "_models.AddressValidationOutput": + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, - validation_request: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ValidationResponse', pipeline_response) + 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def validate_inputs( self, location: str, - validation_request: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ValidationResponse', pipeline_response) + 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'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def region_configuration( self, location: str, - region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs - ) -> "_models.RegionConfigurationResponse": + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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 model 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: RegionConfigurationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 index 84b34d519a62..7ebf80a4150c 100644 --- 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 @@ -6,297 +6,214 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataDestinationDetailsValidationRequest # type: ignore - from ._models import DataDestinationDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import DestinationAccountDetails # type: ignore - from ._models import DestinationManagedDiskDetails # type: ignore - from ._models import DestinationStorageAccountDetails # type: ignore - from ._models import DestinationToServiceLocationMap # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import Error # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobErrorDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +from ._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, - AddressType, - AddressValidationStatus, - ClassDiscriminator, - CopyStatus, - DataDestinationType, - JobDeliveryType, - NotificationStageName, - OverallValidationStatus, - ShareDestinationFormatType, - SkuDisabledReason, - SkuName, - StageName, - StageStatus, - TransportShipmentTypes, - ValidationInputDiscriminator, - ValidationStatus, -) +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 * # type: ignore # 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', + "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 index e3da769b08c0..b7d74a6658fd 100644 --- 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 @@ -6,187 +6,259 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. - -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The address validation status. - """ - - VALID = "Valid" #: Address provided is valid. - INVALID = "Invalid" #: Address provided is invalid or not supported. - AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates the type of job details. - """ - - DATA_BOX = "DataBox" #: Databox orders. - DATA_BOX_DISK = "DataBoxDisk" #: DataboxDisk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataboxHeavy orders. - -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Status of the copy - """ - - NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. - IN_PROGRESS = "InProgress" #: Data copy is in progress. - COMPLETED = "Completed" #: Data copy completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. - FAILED = "Failed" #: Data copy failed. No data was copied. - NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. - HARDWARE_ERROR = "HardwareError" #: The Device has hit hardware issues. - DEVICE_FORMATTED = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. - UNSUPPORTED_DATA = "UnsupportedData" #: Data copy failed. The Device data content is not supported. - -class DataDestinationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Data Destination Type. - """ - - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. - -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Delivery type of Job. - """ - - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. - -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - - DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. - DISPATCHED = "Dispatched" #: Notification at device dispatched stage. - DELIVERED = "Delivered" #: Notification at device delivered stage. - PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. - AT_AZURE_DC = "AtAzureDC" #: Notification at device received at azure datacenter stage. - DATA_COPY = "DataCopy" #: Notification at data copy started stage. - -class OverallValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Overall validation status. - """ - - ALL_VALID_TO_PROCEED = "AllValidToProceed" #: Every input request is valid. - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" #: Some input requests are not valid. - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" #: Certain input validations skipped. - -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the share. - """ - - UNKNOWN_TYPE = "UnknownType" #: Unknown format. - HCS = "HCS" #: Storsimple data format. - BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. - PAGE_BLOB = "PageBlob" #: Azure storage page blob format. - AZURE_FILE = "AzureFile" #: Azure storage file format. - MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. - -class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the Sku is disabled. - """ - - NONE = "None" #: SKU is not disabled. - COUNTRY = "Country" #: SKU is not available in the requested country. - REGION = "Region" #: SKU is not available to push data to the requested Azure region. - FEATURE = "Feature" #: Required features are not enabled for the SKU. - OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Databox. - DATA_BOX_DISK = "DataBoxDisk" #: DataboxDisk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataboxHeavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage which is in progress. - """ - - DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. - DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. - DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. - DELIVERED = "Delivered" #: Device has been delivered to the user of the order. - PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to azure datacenter. - AT_AZURE_DC = "AtAzureDC" #: Device has been received at azure datacenter from the user. - DATA_COPY = "DataCopy" #: Data copy from the device at azure datacenter. - COMPLETED = "Completed" #: Order has completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. - CANCELLED = "Cancelled" #: Order has been cancelled. - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at azure datacenter. - ABORTED = "Aborted" #: Order has been aborted. - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" #: Order has completed with warnings. - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. - -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the job stage. - """ - - NONE = "None" #: No status available yet. - IN_PROGRESS = "InProgress" #: Stage is in progress. - SUCCEEDED = "Succeeded" #: Stage has succeeded. - FAILED = "Failed" #: Stage has failed. - CANCELLED = "Cancelled" #: Stage has been cancelled. - CANCELLING = "Cancelling" #: Stage is cancelling. - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. - -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Transport Shipment Type supported for given region. - """ - - CUSTOMER_MANAGED = "CustomerManaged" #: Shipment Logistics is handled by the customer. - MICROSOFT_MANAGED = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. - -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Identifies the type of validation request. - """ - - VALIDATE_ADDRESS = "ValidateAddress" #: Identify request and response of address validation. - VALIDATE_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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Create order limit validation status. - """ - - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AccessProtocol.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Databox orders. + DATA_BOX = "DataBox" + #: DataboxDisk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: DataboxHeavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + + +class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Data Destination Type.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Databox. + DATA_BOX = "DataBox" + #: DataboxDisk. + DATA_BOX_DISK = "DataBoxDisk" + #: DataboxHeavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response of data destination details validation. + VALIDATE_DATA_DESTINATION_DETAILS = "ValidateDataDestinationDetails" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py deleted file mode 100644 index 0d62bb7ec209..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py +++ /dev/null @@ -1,3351 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_name: Name of the account. - :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint to use the account - as a storage endpoint on the device. - :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - 'account_name': {'readonly': True}, - 'data_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 - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.data_destination_type = None - self.account_connection_string = None - self.share_credential_details = None - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - self.validation_status = None - self.alternate_addresses = None - - -class ValidationInputResponse(msrest.serialization.Model): - """Minimum properties that should be present in each individual validation response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, 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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.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 - ): - super(ValidationInputResponse, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - - -class AddressValidationProperties(ValidationInputResponse): - """The address validation output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_status': {'key': 'validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.validation_status = None - self.alternate_addresses = None - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.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, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class CloudError(msrest.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 - :param target: Error target. - :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.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, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _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, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - } - - _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} - } - - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.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 data_destination_type: Data Destination Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.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: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming - conventions which were processed by automatic renaming. - :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long - """ - - _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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__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(msrest.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. - - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type 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, - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) - self.individual_request_details = kwargs['individual_request_details'] - self.validation_category = None # type: Optional[str] - - -class CreateJobValidations(ValidationRequest): - """It does all pre-job creation validations. - - All required parameters must be populated in order to send to Azure. - - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type 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, - **kwargs - ): - super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' # type: str - - -class ValidationInputRequest(msrest.serialization.Model): - """Minimum fields that must be present in any type of validation request. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataDestinationDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - 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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - 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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, - 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.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: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """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. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs['shipping_address'] - self.delivery_package = None - self.return_package = None - self.destination_account_details = kwargs['destination_account_details'] - self.error_details = None - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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 - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type 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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.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, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - self.dc_access_security_code = kwargs.get('dc_access_security_code', 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. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'required': True}, - '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, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """Databox Heavy Device Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -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. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.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.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, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.serialization.Model): - """The secrets related to a databox heavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """Databox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a databox job. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.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, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class ScheduleAvailabilityRequest(msrest.serialization.Model): - """Request body to get the availability for scheduling orders. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] - self.sku_name = None # type: Optional[str] - - -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. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' # type: str - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param destination_account_details: Required. Destination account details list. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str - """ - - _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, - **kwargs - ): - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str - self.destination_account_details = kwargs['destination_account_details'] - self.location = kwargs['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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Data destination details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str - self.status = None - - -class DcAccessSecurityCode(msrest.serialization.Model): - """Dc Access Security code for device. - - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str - """ - - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - - -class DestinationAccountDetails(msrest.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. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - """ - - _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, - **kwargs - ): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.data_destination_type = None # type: Optional[str] - self.account_id = kwargs.get('account_id', None) - self.share_password = kwargs.get('share_password', None) - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _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, - **kwargs - ): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.data_destination_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['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. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type 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, - **kwargs - ): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.data_destination_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class DestinationToServiceLocationMap(msrest.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 - ): - super(DestinationToServiceLocationMap, self).__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. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, - } - - _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class Error(msrest.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 - ): - super(Error, self).__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. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' # type: str - - -class JobDeliveryInfo(msrest.serialization.Model): - """Additional delivery info. - - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime - """ - - _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) - - -class JobErrorDetails(msrest.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 - ): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - """ - - _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, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :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, - **kwargs - ): - super(JobResource, self).__init__(**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 = kwargs.get('details', None) - self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.is_cancellable_without_fee = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) - - -class JobStages(msrest.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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_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: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.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 - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - self.error_details = None - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type 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, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :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 - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type 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, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: Preferred Data Center Region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference requested with respect to transport type and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _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, - **kwargs - ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _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 - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.status = None - - -class RegionConfigurationRequest(msrest.serialization.Model): - """Request body to get the configuration for the region. - - :param schedule_availability_request: Request body to get the availability for scheduling - orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given - sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest - """ - - _attribute_map = { - 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, - } - - def __init__( - self, - **kwargs - ): - super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) - - -class RegionConfigurationResponse(msrest.serialization.Model): - """Configuration response specific to a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar schedule_availability_response: Schedule availability for given sku in a region. - :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse - """ - - _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 - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - - -class ScheduleAvailabilityResponse(msrest.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 - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) - self.available_dates = None - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _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, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.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 - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type 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, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type 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, - **kwargs - ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.status = None - - -class SkuCapacity(msrest.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 - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _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 - ): - super(SkuInformation, self).__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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - - -class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): - """Properties of subscription permission to create job validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _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 - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - self.status = None - - -class TransportAvailabilityDetails(msrest.serialization.Model): - """Transport options availability details for given region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar shipment_type: Transport Shipment Type supported for given region. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'shipment_type': {'readonly': True}, - } - - _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None - - -class TransportAvailabilityRequest(msrest.serialization.Model): - """Request body to get the transport availability for given sku. - - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) - - -class TransportAvailabilityResponse(msrest.serialization.Model): - """Transport options available for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transport_availability_details: List of transport availability details for given region. - :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] - """ - - _validation = { - 'transport_availability_details': {'readonly': True}, - } - - _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) - self.transport_availability_details = None - - -class TransportPreferences(msrest.serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'preferred_shipment_type': {'required': True}, - } - - _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] - - -class UnencryptedCredentials(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - """ - - _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - - -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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _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, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class ValidationResponse(msrest.serialization.Model): - """Response of pre job creation validations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain validationType and its - response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] - """ - - _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__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/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py index 89c416984590..a22e68d7b7ec 100644 --- 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 @@ -1,4 +1,5 @@ # 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. @@ -7,136 +8,147 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Dict, List, Optional, TYPE_CHECKING, Union -import msrest.serialization +from ... import _serialization -from ._data_box_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models -class AccountCredentialDetails(msrest.serialization.Model): +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. Possible values include: "StorageAccount", + :ivar data_destination_type: Data Destination Type. Known values are: "StorageAccount" and "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType + :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.models.ShareCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(AccountCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.account_name = None self.data_destination_type = None self.account_connection_string = None self.share_credential_details = None -class AddressValidationOutput(msrest.serialization.Model): +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. - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2019_09_01.models.ShippingAddress] """ _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, + "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]'}, + "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 - ): - super(AddressValidationOutput, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None self.validation_status = None self.alternate_addresses = None -class ValidationInputResponse(msrest.serialization.Model): +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. + 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. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, + "validation_type": {"required": True}, + "error": {"readonly": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, + "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 - ): - super(ValidationInputResponse, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "AddressValidationProperties", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationResponseProperties", + "ValidateDataDestinationDetails": "DataDestinationDetailsValidationResponseProperties", + "ValidatePreferences": "PreferencesValidationResponseProperties", + "ValidateSkuAvailability": "SkuAvailabilityValidationResponseProperties", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationResponseProperties", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -148,45 +160,45 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :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}, + "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]'}, + "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 - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str self.validation_status = None self.alternate_addresses = None -class ApplianceNetworkConfiguration(msrest.serialization.Model): +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. @@ -198,25 +210,23 @@ class ApplianceNetworkConfiguration(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, + "name": {"readonly": True}, + "mac_address": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "mac_address": {"key": "macAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(msrest.serialization.Model): +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. @@ -230,134 +240,137 @@ class ArmBaseObject(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, + "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'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(msrest.serialization.Model): +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: Required. Type of the transfer. Default value: "ImportToAzure". + :ivar transfer_type: Type of the transfer. Required. Default value is "ImportToAzure". :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + 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}, + "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": {"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, "SkuName"]]] = None, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) + self, *, country: str, location: str, sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, **kwargs + ): + """ + :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(msrest.serialization.Model): +class AvailableSkusResult(_serialization.Model): """The available skus operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SkuInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class CancellationReason(_serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs): + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason -class CloudError(msrest.serialization.Model): +class CloudError(_serialization.Model): """The error information object. Variables are only populated by the server, and will be ignored when sending a request. @@ -366,70 +379,71 @@ class CloudError(msrest.serialization.Model): :vartype code: str :ivar message: Descriptive error information. :vartype message: str - :param target: Error target. - :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :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}, + "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]'}, + "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["CloudError"]] = None, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) + def __init__(self, *, target: Optional[str] = None, details: Optional[List["_models.CloudError"]] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class ContactDetails(_serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :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}, + "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]'}, + "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__( @@ -440,10 +454,25 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - notification_preference: Optional[List["NotificationPreference"]] = None, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) + notification_preference: Optional[List["_models.NotificationPreference"]] = None, + **kwargs + ): + """ + :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 @@ -452,105 +481,107 @@ def __init__( self.notification_preference = notification_preference -class CopyLogDetails(msrest.serialization.Model): +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. + 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. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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}, + "copy_log_details_type": {"required": True}, } _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, } _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} + "copy_log_details_type": { + "DataBox": "DataBoxAccountCopyLogDetails", + "DataBoxDisk": "DataBoxDiskCopyLogDetails", + "DataBoxHeavy": "DataBoxHeavyAccountCopyLogDetails", + } } - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(msrest.serialization.Model): +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. Possible values include: "StorageAccount", + :ivar data_destination_type: Data Destination Type. Known values are: "StorageAccount" and "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType + :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: long + :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: long + :vartype total_bytes_to_process: int :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long + :vartype files_processed: int :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long + :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: long + :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: long + :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: long + :vartype renamed_container_count: int :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long + :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}, + "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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + "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 - ): - super(CopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.storage_account_name = None self.data_destination_type = None self.account_id = None @@ -564,43 +595,43 @@ def __init__( self.files_errored_out = None -class ValidationRequest(msrest.serialization.Model): +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. + 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. - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type 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.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}, + "individual_request_details": {"required": True}, + "validation_category": {"required": True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, + "validation_category": {"key": "validationCategory", "type": "str"}, } - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } + _subtype_map = {"validation_category": {"JobCreationValidation": "CreateJobValidations"}} - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = None # type: Optional[str] @@ -610,66 +641,76 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type 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.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}, + "individual_request_details": {"required": True}, + "validation_category": {"required": True}, } _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, + "validation_category": {"key": "validationCategory", "type": "str"}, } - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category = 'JobCreationValidation' # type: str + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = "JobCreationValidation" # type: str -class ValidationInputRequest(msrest.serialization.Model): +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. + 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. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + and "ValidateSkuAvailability". + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator """ _validation = { - 'validation_type': {'required': True}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "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 - ): - super(ValidationInputRequest, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "ValidateAddress", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationRequest", + "ValidateDataDestinationDetails": "DataDestinationDetailsValidationRequest", + "ValidatePreferences": "PreferencesValidationRequest", + "ValidateSkuAvailability": "SkuAvailabilityValidationRequest", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationRequest", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -678,34 +719,35 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + 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}, + "validation_type": {"required": True}, + "device_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, + "validation_type": {"key": "validationType", "type": "str"}, + "device_type": {"key": "deviceType", "type": "str"}, } - def __init__( - self, - *, - device_type: Union[str, "SkuName"], - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs): + """ + :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 = "ValidateCreateOrderLimit" # type: str self.device_type = device_type @@ -716,36 +758,35 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str self.status = None @@ -756,9 +797,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -766,23 +808,21 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str self.account_name = None self.copy_log_link = None @@ -794,9 +834,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -806,31 +847,29 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None -class DataBoxDiskCopyProgress(msrest.serialization.Model): +class DataBoxDiskCopyProgress(_serialization.Model): """DataBox Disk Copy Progress. Variables are only populated by the server, and will be ignored when sending a request. @@ -838,74 +877,74 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long + :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. Possible values include: "NotStarted", "InProgress", + :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + "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}, + "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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, + "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 - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.serial_number = None self.bytes_copied = None self.percent_complete = None self.status = None -class JobDetails(msrest.serialization.Model): +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. + 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. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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. @@ -913,51 +952,69 @@ class JobDetails(msrest.serialization.Model): """ _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, + "job_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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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'}, + "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'} + "job_details_type": { + "DataBox": "DataBoxJobDetails", + "DataBoxDisk": "DataBoxDiskJobDetails", + "DataBoxHeavy": "DataBoxHeavyJobDetails", + } } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, - preferences: Optional["Preferences"] = None, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + 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 + ): + """ + :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 @@ -972,145 +1029,176 @@ def __init__( self.chain_of_custody_sas_key = None -class DataBoxDiskJobDetails(JobDetails): +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. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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 - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :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. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :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] - :param passkey: User entered passkey for DataBox Disk job. - :type 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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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'}, + :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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, - preferences: Optional["Preferences"] = None, + 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 ): - super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) - self.job_details_type = 'DataBoxDisk' # type: str + """ + :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 = "DataBoxDisk" # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey -class JobSecrets(msrest.serialization.Model): +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. + 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. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :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}, + "job_secrets_type": {"required": True}, } _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + "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["DcAccessSecurityCode"] = None, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) + "job_secrets_type": { + "DataBox": "DataboxJobSecrets", + "DataBoxDisk": "DataBoxDiskJobSecrets", + "DataBoxHeavy": "DataBoxHeavyJobSecrets", + } + } + + def __init__(self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.dc_access_security_code = dc_access_security_code @@ -1122,13 +1210,13 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :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.models.DiskSecret] + :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. @@ -1136,28 +1224,27 @@ class DataBoxDiskJobSecrets(JobSecrets): """ _validation = { - 'job_secrets_type': {'required': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, + "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'}, + "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["DcAccessSecurityCode"] = None, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str + def __init__(self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs): + """ + :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 = "DataBoxDisk" # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None @@ -1170,9 +1257,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -1180,114 +1268,136 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, + "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]'}, + "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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str self.account_name = None self.copy_log_link = None -class DataBoxHeavyJobDetails(JobDetails): +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. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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'}, + :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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, - preferences: Optional["Preferences"] = None, + 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 ): - super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str + """ + :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 = "DataBoxHeavy" # type: str self.copy_progress = None self.device_password = device_password @@ -1299,38 +1409,37 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :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.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxHeavySecret] """ _validation = { - 'job_secrets_type': {'required': True}, - 'cabinet_pod_secrets': {'readonly': True}, + "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]'}, + "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["DcAccessSecurityCode"] = None, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str + def __init__(self, *, dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, **kwargs): + """ + :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 = "DataBoxHeavy" # type: str self.cabinet_pod_secrets = None -class DataBoxHeavySecret(msrest.serialization.Model): +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. @@ -1340,35 +1449,35 @@ class DataBoxHeavySecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1376,93 +1485,117 @@ def __init__( self.account_credential_details = None -class DataBoxJobDetails(JobDetails): +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. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - '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'}, + :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: "ContactDetails", - shipping_address: "ShippingAddress", - destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, - preferences: Optional["Preferences"] = None, + 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 ): - super(DataBoxJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) - self.job_details_type = 'DataBox' # type: str + """ + :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 = "DataBox" # type: str self.copy_progress = None self.device_password = device_password @@ -1472,75 +1605,89 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :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}, + "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]'}, + "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["DcAccessSecurityCode"] = None, - pod_secrets: Optional[List["DataBoxSecret"]] = None, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) - self.job_secrets_type = 'DataBox' # type: str + dc_access_security_code: Optional["_models.DcAccessSecurityCode"] = None, + pod_secrets: Optional[List["_models.DataBoxSecret"]] = None, + **kwargs + ): + """ + :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 = "DataBox" # type: str self.pod_secrets = pod_secrets -class ScheduleAvailabilityRequest(msrest.serialization.Model): +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. + 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. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :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}, + "storage_location": {"required": True}, + "sku_name": {"required": True}, } _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "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 - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) + "sku_name": { + "DataBox": "DataBoxScheduleAvailabilityRequest", + "DataBoxDisk": "DiskScheduleAvailabilityRequest", + "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", + } + } + + def __init__(self, *, storage_location: str, **kwargs): + """ + :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 = None # type: Optional[str] @@ -1550,36 +1697,39 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :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}, + "storage_location": {"required": True}, + "sku_name": {"required": True}, } _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "storage_location": {"key": "storageLocation", "type": "str"}, + "sku_name": {"key": "skuName", "type": "str"}, } - def __init__( - self, - *, - storage_location: str, - **kwargs - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBox' # type: str + def __init__(self, *, storage_location: str, **kwargs): + """ + :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 = "DataBox" # type: str -class DataBoxSecret(msrest.serialization.Model): +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. @@ -1589,35 +1739,35 @@ class DataBoxSecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1630,38 +1780,43 @@ class DataDestinationDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param destination_account_details: Required. Destination account details list. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + 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}, + "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'}, + "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["DestinationAccountDetails"], - location: str, - **kwargs + self, *, destination_account_details: List["_models.DestinationAccountDetails"], location: str, **kwargs ): - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str + """ + :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 = "ValidateDataDestinationDetails" # type: str self.destination_account_details = destination_account_details self.location = location @@ -1673,104 +1828,109 @@ class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar status: Data destination details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataDestinationDetails" # type: str self.status = None -class DcAccessSecurityCode(msrest.serialization.Model): +class DcAccessSecurityCode(_serialization.Model): """Dc Access Security code for device. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + :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'}, + "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 + self, *, forward_dc_access_code: Optional[str] = None, reverse_dc_access_code: Optional[str] = None, **kwargs ): - super(DcAccessSecurityCode, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. + 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. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str + :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}, + "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'}, + "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 - ): - super(DestinationAccountDetails, self).__init__(**kwargs) + "data_destination_type": { + "ManagedDisk": "DestinationManagedDiskDetails", + "StorageAccount": "DestinationStorageAccountDetails", + } + } + + def __init__(self, *, account_id: Optional[str] = None, share_password: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.account_id = account_id self.share_password = share_password @@ -1781,33 +1941,34 @@ class DestinationManagedDiskDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str + :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}, + "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'}, + "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__( @@ -1819,8 +1980,20 @@ def __init__( share_password: Optional[str] = None, **kwargs ): - super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.data_destination_type = 'ManagedDisk' # type: str + """ + :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 = "ManagedDisk" # type: str self.resource_group_id = resource_group_id self.staging_storage_account_id = staging_storage_account_id @@ -1830,27 +2003,28 @@ class DestinationStorageAccountDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :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}, + "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'}, + "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__( @@ -1861,12 +2035,20 @@ def __init__( share_password: Optional[str] = None, **kwargs ): - super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) - self.data_destination_type = 'StorageAccount' # type: str + """ + :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 = "StorageAccount" # type: str self.storage_account_id = storage_account_id -class DestinationToServiceLocationMap(msrest.serialization.Model): +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. @@ -1878,20 +2060,18 @@ class DestinationToServiceLocationMap(msrest.serialization.Model): """ _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, + "destination_location": {"readonly": True}, + "service_location": {"readonly": True}, } _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + "destination_location": {"key": "destinationLocation", "type": "str"}, + "service_location": {"key": "serviceLocation", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.destination_location = None self.service_location = None @@ -1901,43 +2081,48 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :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_terabytes': {'required': True}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + "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_terabytes: int, - **kwargs - ): - super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + def __init__(self, *, storage_location: str, expected_data_size_in_tera_bytes: int, **kwargs): + """ + :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 = "DataBoxDisk" # type: str + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes -class DiskSecret(msrest.serialization.Model): +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. @@ -1950,25 +2135,23 @@ class DiskSecret(msrest.serialization.Model): """ _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, + "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'}, + "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, + "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class Error(msrest.serialization.Model): +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. @@ -1980,20 +2163,18 @@ class Error(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.code = None self.message = None @@ -2003,57 +2184,59 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :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}, + "storage_location": {"required": True}, + "sku_name": {"required": True}, } _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "storage_location": {"key": "storageLocation", "type": "str"}, + "sku_name": {"key": "skuName", "type": "str"}, } - def __init__( - self, - *, - storage_location: str, - **kwargs - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) - self.sku_name = 'DataBoxHeavy' # type: str + def __init__(self, *, storage_location: str, **kwargs): + """ + :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 = "DataBoxHeavy" # type: str -class JobDeliveryInfo(msrest.serialization.Model): +class JobDeliveryInfo(_serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + "scheduled_date_time": {"key": "scheduledDateTime", "type": "iso-8601"}, } - def __init__( - self, - *, - scheduled_date_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) + def __init__(self, *, scheduled_date_time: Optional[datetime.datetime] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. @@ -2069,89 +2252,92 @@ class JobErrorDetails(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, + "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'}, + "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 - ): - super(JobErrorDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.error_message = None self.error_code = None self.recommended_action = None self.exception_message = None -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :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}, + "location": {"required": True}, + "sku": {"required": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - *, - location: str, - sku: "Sku", - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(Resource, self).__init__(**kwargs) + def __init__(self, *, location: str, sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, **kwargs): + """ + :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): +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. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :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. @@ -2164,77 +2350,94 @@ class JobResource(Resource): :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. Possible values include: "DeviceOrdered", + :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". - :vartype status: str or ~azure.mgmt.databox.models.StageName + "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.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~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 - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar 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'}, + "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: "Sku", + sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, - details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, - delivery_info: Optional["JobDeliveryInfo"] = None, - **kwargs - ): - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + details: Optional["_models.JobDetails"] = None, + delivery_type: Union[str, "_models.JobDeliveryType"] = "NonScheduled", + delivery_info: Optional["_models.JobDeliveryInfo"] = None, + **kwargs + ): + """ + :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 @@ -2251,111 +2454,125 @@ def __init__( self.is_cancellable_without_fee = None -class JobResourceList(msrest.serialization.Model): +class JobResourceList(_serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["JobResource"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs ): - super(JobResourceList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class JobResourceUpdateParameter(_serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :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]'}, + "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["UpdateJobDetails"] = None, - destination_account_details: Optional[List["DestinationAccountDetails"]] = None, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) + details: Optional["_models.UpdateJobDetails"] = None, + destination_account_details: Optional[List["_models.DestinationAccountDetails"]] = None, + **kwargs + ): + """ + :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(msrest.serialization.Model): +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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + :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". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + "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. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :ivar stage_status: Status of the job stage. 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: object + :vartype job_stage_details: JSON :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :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}, + "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]'}, + "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 - ): - super(JobStages, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None @@ -2364,41 +2581,44 @@ def __init__( self.error_details = None -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :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}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool = True, **kwargs ): - super(NotificationPreference, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Operation(_serialization.Model): """Operation entity. Variables are only populated by the server, and will be ignored when sending a request. @@ -2407,56 +2627,54 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2019_09_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :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}, + "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'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "properties": {"key": "properties", "type": "object"}, + "origin": {"key": "origin", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :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'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -2468,45 +2686,54 @@ def __init__( description: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class OperationList(_serialization.Model): """Operation Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class PackageShippingDetails(_serialization.Model): """Shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2520,49 +2747,53 @@ class PackageShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "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'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :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'}, + "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["TransportPreferences"] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, **kwargs ): - super(Preferences, self).__init__(**kwargs) + """ + :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 @@ -2572,38 +2803,46 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference requested with respect to transport type and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + 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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "preference": {"key": "preference", "type": "Preferences"}, + "device_type": {"key": "deviceType", "type": "str"}, } def __init__( self, *, - device_type: Union[str, "SkuName"], - preference: Optional["Preferences"] = None, - **kwargs - ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + device_type: Union[str, "_models.SkuName"], + preference: Optional["_models.Preferences"] = None, + **kwargs + ): + """ + :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 = "ValidatePreferences" # type: str self.preference = preference self.device_type = device_type @@ -2615,100 +2854,118 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str self.status = None -class RegionConfigurationRequest(msrest.serialization.Model): +class RegionConfigurationRequest(_serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :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. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :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'}, + "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, + "transport_availability_request": { + "key": "transportAvailabilityRequest", + "type": "TransportAvailabilityRequest", + }, } def __init__( self, *, - schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["TransportAvailabilityRequest"] = None, - **kwargs - ): - super(RegionConfigurationRequest, self).__init__(**kwargs) + schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, + **kwargs + ): + """ + :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(msrest.serialization.Model): +class RegionConfigurationResponse(_serialization.Model): """Configuration response specific to a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~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.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityResponse """ _validation = { - 'schedule_availability_response': {'readonly': True}, - 'transport_availability_response': {'readonly': True}, + "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'}, + "schedule_availability_response": { + "key": "scheduleAvailabilityResponse", + "type": "ScheduleAvailabilityResponse", + }, + "transport_availability_response": { + "key": "transportAvailabilityResponse", + "type": "TransportAvailabilityResponse", + }, } - def __init__( - self, - **kwargs - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ScheduleAvailabilityResponse(msrest.serialization.Model): +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. @@ -2718,60 +2975,57 @@ class ScheduleAvailabilityResponse(msrest.serialization.Model): """ _validation = { - 'available_dates': {'readonly': True}, + "available_dates": {"readonly": True}, } _attribute_map = { - 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, + "available_dates": {"key": "availableDates", "type": "[iso-8601]"}, } - def __init__( - self, - **kwargs - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(msrest.serialization.Model): +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. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. 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.models.AccessProtocol] + :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}, + "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]'}, + "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 - ): - super(ShareCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.share_name = None self.share_type = None self.user_name = None @@ -2779,48 +3033,51 @@ def __init__( self.supported_access_protocols = None -class ShipmentPickUpRequest(msrest.serialization.Model): +class ShipmentPickUpRequest(_serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :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}, + "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'}, + "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 - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) + def __init__(self, *, start_time: datetime.datetime, end_time: datetime.datetime, shipment_location: str, **kwargs): + """ + :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(msrest.serialization.Model): +class ShipmentPickUpResponse(_serialization.Model): """Shipment pick up response. Variables are only populated by the server, and will be ignored when sending a request. @@ -2833,69 +3090,66 @@ class ShipmentPickUpResponse(msrest.serialization.Model): """ _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, + "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'}, + "confirmation_number": {"key": "confirmationNumber", "type": "str"}, + "ready_by_time": {"key": "readyByTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(msrest.serialization.Model): +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. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _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'}, + :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__( @@ -2910,10 +3164,33 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) + address_type: Union[str, "_models.AddressType"] = "None", + **kwargs + ): + """ + :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 @@ -2926,39 +3203,48 @@ def __init__( self.address_type = address_type -class Sku(msrest.serialization.Model): +class Sku(_serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :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}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "family": {"key": "family", "type": "str"}, } def __init__( self, *, - name: Union[str, "SkuName"], + name: Union[str, "_models.SkuName"], display_name: Optional[str] = None, family: Optional[str] = None, **kwargs ): - super(Sku, self).__init__(**kwargs) + """ + :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 @@ -2971,52 +3257,59 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". + 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 - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str + 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}, + "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'}, + "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, "SkuName"], - country: str, - location: str, - **kwargs - ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + def __init__(self, *, device_type: Union[str, "_models.SkuName"], country: str, location: str, **kwargs): + """ + :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 = "ValidateSkuAvailability" # type: str self.device_type = device_type self.country = country self.location = location @@ -3029,40 +3322,39 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + :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.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str self.status = None -class SkuCapacity(msrest.serialization.Model): +class SkuCapacity(_serialization.Model): """Capacity of the sku. Variables are only populated by the server, and will be ignored when sending a request. @@ -3074,25 +3366,23 @@ class SkuCapacity(msrest.serialization.Model): """ _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, + "usable": {"readonly": True}, + "maximum": {"readonly": True}, } _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, + "usable": {"key": "usable", "type": "str"}, + "maximum": {"key": "maximum", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(msrest.serialization.Model): +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. @@ -3104,45 +3394,43 @@ class SkuCost(msrest.serialization.Model): """ _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, + "meter_id": {"readonly": True}, + "meter_type": {"readonly": True}, } _attribute_map = { - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_type': {'key': 'meterType', 'type': 'str'}, + "meter_id": {"key": "meterId", "type": "str"}, + "meter_type": {"key": "meterType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.meter_id = None self.meter_type = None -class SkuInformation(msrest.serialization.Model): +class SkuInformation(_serialization.Model): """Information of the sku. Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :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.models.DestinationToServiceLocationMap] + list[~azure.mgmt.databox.v2019_09_01.models.DestinationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2019_09_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :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. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. 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. @@ -3150,34 +3438,35 @@ class SkuInformation(msrest.serialization.Model): """ _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}, + "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'}, + "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 - ): - super(SkuInformation, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.sku = None self.enabled = None self.destination_to_service_location_map = None @@ -3194,27 +3483,26 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + and "ValidateSkuAvailability". + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator """ _validation = { - 'validation_type': {'required': True}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "validation_type": {"key": "validationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): @@ -3224,142 +3512,142 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation response. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + 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.models.Error - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str self.status = None -class TransportAvailabilityDetails(msrest.serialization.Model): +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. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "shipment_type": {"readonly": True}, } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + "shipment_type": {"key": "shipmentType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.shipment_type = None -class TransportAvailabilityRequest(msrest.serialization.Model): +class TransportAvailabilityRequest(_serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "sku_name": {"key": "skuName", "type": "str"}, } - def __init__( - self, - *, - sku_name: Optional[Union[str, "SkuName"]] = None, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) + def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class TransportAvailabilityResponse(_serialization.Model): """Transport options available for given sku in a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityDetails] """ _validation = { - 'transport_availability_details': {'readonly': True}, + "transport_availability_details": {"readonly": True}, } _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, + "transport_availability_details": { + "key": "transportAvailabilityDetails", + "type": "[TransportAvailabilityDetails]", + }, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(msrest.serialization.Model): +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. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "preferred_shipment_type": {"required": True}, } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, } - def __init__( - self, - *, - preferred_shipment_type: Union[str, "TransportShipmentTypes"], - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs): + """ + :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(msrest.serialization.Model): +class UnencryptedCredentials(_serialization.Model): """Unencrypted credentials for accessing device. Variables are only populated by the server, and will be ignored when sending a request. @@ -3367,76 +3655,86 @@ class UnencryptedCredentials(msrest.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.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2019_09_01.models.JobSecrets """ _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, + "job_name": {"readonly": True}, + "job_secrets": {"readonly": True}, } _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, + "job_name": {"key": "jobName", "type": "str"}, + "job_secrets": {"key": "jobSecrets", "type": "JobSecrets"}, } - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_name = None self.job_secrets = None -class UnencryptedCredentialsList(msrest.serialization.Model): +class UnencryptedCredentialsList(_serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[UnencryptedCredentials]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["UnencryptedCredentials"]] = None, + value: Optional[List["_models.UnencryptedCredentials"]] = None, next_link: Optional[str] = None, **kwargs ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class UpdateJobDetails(_serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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'}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, } def __init__( self, *, - contact_details: Optional["ContactDetails"] = None, - shipping_address: Optional["ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, **kwargs ): - super(UpdateJobDetails, self).__init__(**kwargs) + """ + :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 @@ -3446,75 +3744,87 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Identifies the type of validation request. Required. Known values are: + "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + 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}, + "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'}, + "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: "ShippingAddress", - device_type: Union[str, "SkuName"], - transport_preferences: Optional["TransportPreferences"] = None, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + shipping_address: "_models.ShippingAddress", + device_type: Union[str, "_models.SkuName"], + transport_preferences: Optional["_models.TransportPreferences"] = None, + **kwargs + ): + """ + :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 = "ValidateAddress" # type: str self.shipping_address = shipping_address self.device_type = device_type self.transport_preferences = transport_preferences -class ValidationResponse(msrest.serialization.Model): +class ValidationResponse(_serialization.Model): """Response of pre job creation validations. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :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.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputResponse] """ _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, + "status": {"readonly": True}, + "individual_response_details": {"readonly": True}, } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, + "status": {"key": "properties.status", "type": "str"}, + "individual_response_details": { + "key": "properties.individualResponseDetails", + "type": "[ValidationInputResponse]", + }, } - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index e984b83e43a5..afdbe92235da 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,99 +6,395 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + accept = _headers.pop("Accept", "application/json") -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + # 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 = _format_url_section(_url, **path_format_arguments) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -class JobsOperations(object): - """JobsOperations operations. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. +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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,7 +403,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -115,66 +414,68 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -183,7 +484,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,117 +495,121 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def get( - self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _create_initial( - self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -311,122 +618,202 @@ def _create_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._create_initial( + raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - def _delete_initial( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202, 204]: @@ -436,117 +823,122 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - def begin_delete( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -555,214 +947,455 @@ def _update_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('JobResource', pipeline_response) + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._update_initial( + raw_result = self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :param shipment_pick_up_request: Details of shipment pick up request. Is either a model 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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ShipmentPickUpResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + deserialized = self._deserialize("ShipmentPickUpResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: @@ -772,62 +1405,69 @@ def cancel( if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -836,7 +1476,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -845,7 +1487,6 @@ 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index cc8b34833627..8b670f9a5d5b 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,87 +6,122 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 + -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + accept = _headers.pop("Accept", "application/json") -class Operations(object): - """Operations operations. + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + 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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,7 +130,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,7 +141,6 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index f8cf7bdbaa34..fc3641f25e56 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,106 +6,360 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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"), + } -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + _url = _format_url_section(_url, **path_format_arguments) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -class ServiceOperations(object): - """ServiceOperations operations. + # 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") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + +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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + 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. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,7 +368,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -122,76 +379,145 @@ def get_next(next_link=None): return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + return ItemPaged(get_next, extract_data) + list_available_skus.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + + @overload + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: _models.AvailableSkuRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> 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, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -200,7 +526,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -209,264 +537,503 @@ def get_next(next_link=None): 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressValidationOutput', pipeline_response) + deserialized = self._deserialize("AddressValidationOutput", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ValidationResponse', pipeline_response) + 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ValidationResponse', pipeline_response) + 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'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 index ae972ed54f84..c3f328be41df 100644 --- 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 @@ -10,10 +10,15 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['DataBoxManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import except ImportError: - pass + _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 index 733f2f37acb5..52d92e1e1b95 100644 --- 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 @@ -6,66 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :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, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2020-04-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-04-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index e696cb06a780..0eec3c5b44bf 100644 --- 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 @@ -6,65 +6,85 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import 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 typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_04_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_04_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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 + """ - 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) + 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): # type: () -> None 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 index 1cbb00da5e15..0b1600a02276 100644 --- 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 @@ -5,59 +5,100 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "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, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "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, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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": "None", - "async_imports": "None" + } } \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..9aad73fc743e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = 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 index eae7c95b6fbd..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" 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 index bb6b75a72db8..e9ac07d95558 100644 --- 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 @@ -7,4 +7,15 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # 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 index c07f020ff27a..fd25894aa5a9 100644 --- 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 @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,49 +19,48 @@ from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :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. + :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: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2020-04-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-04-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index b192ff7cd771..5e59697961b3 100644 --- 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 @@ -6,62 +6,85 @@ # 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 azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import 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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_04_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_04_01.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. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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 + """ - 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) + 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() 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index c4130aabaa87..6d23e2920e89 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,94 +6,119 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """JobsOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,75 +127,81 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -178,648 +210,997 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + + @distributed_trace_async async def get( - self, - resource_group_name: str, - job_name: str, - expand: Optional[str] = None, - **kwargs - ) -> "_models.JobResource": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_create( self, resource_group_name: str, job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - async def _delete_initial( - self, - resource_group_name: str, - job_name: str, - **kwargs + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - async def begin_delete( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncLROPoller[None]: + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _update_initial( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], if_match: Optional[str] = None, - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + **kwargs: Any + ) -> Optional[_models.JobResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: _models.JobResourceUpdateParameter, if_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + *, + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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: "_models.ShipmentPickUpRequest", - **kwargs - ) -> "_models.ShipmentPickUpResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - async def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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: "_models.CancellationReason", - **kwargs + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any ) -> None: """CancelJob. - :param resource_group_name: The Resource Group Name. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -828,17 +1209,18 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py index 9447a0929058..9f9dbea95583 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/v2020_04_01/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,82 +6,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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') +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: - """Operations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s + :attr:`operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationList"]: + @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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,17 +109,18 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py index 102a614814c9..34f8af1494bf 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/v2020_04_01/aio/operations/_service_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,106 +6,198 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """ServiceOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s + :attr:`service` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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_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.async_paging.AsyncItemPaged[~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 + ) -> 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_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: "_models.AvailableSkuRequest", - **kwargs - ) -> AsyncIterable["_models.AvailableSkusResult"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,344 +206,666 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload async def validate_address( self, location: str, - validate_address: "_models.ValidateAddress", - **kwargs - ) -> "_models.AddressValidationOutput": + 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 + 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_04_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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :param validate_address: Shipping address of the customer. Is either a model 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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :return: AddressValidationOutput or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 + 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_04_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: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :param validation_request: Inputs of the customer. Is either a model 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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ValidationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def validate_inputs( self, location: str, - validation_request: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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 + 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_04_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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :param validation_request: Inputs of the customer. Is either a model 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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ValidationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def region_configuration( self, location: str, - region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs - ) -> "_models.RegionConfigurationResponse": + 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 + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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_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 model 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: RegionConfigurationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 + 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_04_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: "_models.RegionConfigurationRequest", - **kwargs - ) -> "_models.RegionConfigurationResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :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. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + resource group level. Is either a model 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: RegionConfigurationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 index 03df95cdedfc..5d58b66f9334 100644 --- 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 @@ -6,349 +6,252 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AccountCredentialDetails - from ._models_py3 import AdditionalErrorInfo - from ._models_py3 import AddressValidationOutput - from ._models_py3 import AddressValidationProperties - from ._models_py3 import ApiError - from ._models_py3 import ApplianceNetworkConfiguration - from ._models_py3 import ArmBaseObject - from ._models_py3 import AvailableSkuRequest - from ._models_py3 import AvailableSkusResult - from ._models_py3 import AzureFileFilterDetails - from ._models_py3 import BlobFilterDetails - from ._models_py3 import CancellationReason - from ._models_py3 import CloudError - from ._models_py3 import ContactDetails - from ._models_py3 import CopyLogDetails - from ._models_py3 import CopyProgress - from ._models_py3 import CreateJobValidations - from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest - from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties - from ._models_py3 import DataAccountDetails - from ._models_py3 import DataBoxAccountCopyLogDetails - from ._models_py3 import DataBoxDiskCopyLogDetails - from ._models_py3 import DataBoxDiskCopyProgress - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AdditionalErrorInfo # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApiError # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import AzureFileFilterDetails # type: ignore - from ._models import BlobFilterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataAccountDetails # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataExportDetails # type: ignore - from ._models import DataImportDetails # type: ignore - from ._models import DataLocationToServiceLocationMap # type: ignore - from ._models import DataTransferDetailsValidationRequest # type: ignore - from ._models import DataTransferDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import Details # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import FilterFileDetails # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import KeyEncryptionKey # type: ignore - from ._models import ManagedDiskDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransferAllDetails # type: ignore - from ._models import TransferConfiguration # type: ignore - from ._models import TransferConfigurationTransferAllDetails # type: ignore - from ._models import TransferConfigurationTransferFilterDetails # type: ignore - from ._models import TransferFilterDetails # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +from ._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, - AddressType, - AddressValidationStatus, - ClassDiscriminator, - CopyStatus, - DataAccountType, - FilterFileType, - JobDeliveryType, - KekType, - LogCollectionLevel, - NotificationStageName, - OverallValidationStatus, - ShareDestinationFormatType, - SkuDisabledReason, - SkuName, - StageName, - StageStatus, - TransferConfigurationType, - TransferType, - TransportShipmentTypes, - ValidationInputDiscriminator, - ValidationStatus, -) +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 * # type: ignore # 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', + "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 index 88bd323185f7..00f14fca2e79 100644 --- 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 @@ -6,224 +6,308 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. - -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The address validation status. - """ - - VALID = "Valid" #: Address provided is valid. - INVALID = "Invalid" #: Address provided is invalid or not supported. - AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates the type of job details. - """ - - DATA_BOX = "DataBox" #: Data Box orders. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy orders. - -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Status of the copy - """ - - NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. - IN_PROGRESS = "InProgress" #: Data copy is in progress. - COMPLETED = "Completed" #: Data copy completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. - FAILED = "Failed" #: Data copy failed. No data was copied. - NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. - HARDWARE_ERROR = "HardwareError" #: The Device has hit hardware issues. - DEVICE_FORMATTED = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. - UNSUPPORTED_DATA = "UnsupportedData" #: Data copy failed. The Device data content is not supported. - -class DataAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the account. - """ - - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. - -class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the filter file. - """ - - AZURE_BLOB = "AzureBlob" #: Filter file is of the type AzureBlob. - AZURE_FILE = "AzureFile" #: Filter file is of the type AzureFiles. - -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Delivery type of Job. - """ - - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. - -class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of encryption key used for key encryption. - """ - - MICROSOFT_MANAGED = "MicrosoftManaged" #: Key encryption key is managed by Microsoft. - CUSTOMER_MANAGED = "CustomerManaged" #: Key encryption key is managed by the Customer. - -class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Level of the logs to be collected. - """ - - ERROR = "Error" #: Only Errors will be collected in the logs. - VERBOSE = "Verbose" #: Verbose logging (includes Errors, CRC, size information and others). - -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - - DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. - DISPATCHED = "Dispatched" #: Notification at device dispatched stage. - DELIVERED = "Delivered" #: Notification at device delivered stage. - PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. - AT_AZURE_DC = "AtAzureDC" #: Notification at device received at Azure datacenter stage. - DATA_COPY = "DataCopy" #: Notification at data copy started stage. - -class OverallValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Overall validation status. - """ - - ALL_VALID_TO_PROCEED = "AllValidToProceed" #: Every input request is valid. - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" #: Some input requests are not valid. - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" #: Certain input validations skipped. - -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the share. - """ - - UNKNOWN_TYPE = "UnknownType" #: Unknown format. - HCS = "HCS" #: Storsimple data format. - BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. - PAGE_BLOB = "PageBlob" #: Azure storage page blob format. - AZURE_FILE = "AzureFile" #: Azure storage file format. - MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. - -class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the Sku is disabled. - """ - - NONE = "None" #: SKU is not disabled. - COUNTRY = "Country" #: SKU is not available in the requested country. - REGION = "Region" #: SKU is not available to push data to the requested Azure region. - FEATURE = "Feature" #: Required features are not enabled for the SKU. - OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Data Box. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage which is in progress. - """ - - DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. - DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. - DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. - DELIVERED = "Delivered" #: Device has been delivered to the user of the order. - PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to Azure datacenter. - AT_AZURE_DC = "AtAzureDC" #: Device has been received at Azure datacenter from the user. - DATA_COPY = "DataCopy" #: Data copy from the device at Azure datacenter. - COMPLETED = "Completed" #: Order has completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. - CANCELLED = "Cancelled" #: Order has been cancelled. - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at Azure datacenter. - ABORTED = "Aborted" #: Order has been aborted. - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" #: Order has completed with warnings. - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. - -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the job stage. - """ - - NONE = "None" #: No status available yet. - IN_PROGRESS = "InProgress" #: Stage is in progress. - SUCCEEDED = "Succeeded" #: Stage has succeeded. - FAILED = "Failed" #: Stage has failed. - CANCELLED = "Cancelled" #: Stage has been cancelled. - CANCELLING = "Cancelling" #: Stage is cancelling. - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" #: Stage is stuck until customer takes some action. - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" #: Stage has succeeded with warnings. - -class TransferConfigurationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the configuration for transfer. - """ - - TRANSFER_ALL = "TransferAll" #: Transfer all the data. - TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. - -class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the transfer. - """ - - IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. - EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. - -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Transport Shipment Type supported for given region. - """ - - CUSTOMER_MANAGED = "CustomerManaged" #: Shipment Logistics is handled by the customer. - MICROSOFT_MANAGED = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. - -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Identifies the type of validation request. - """ - - VALIDATE_ADDRESS = "ValidateAddress" #: Identify request and response of address validation. - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" #: Identify request and response for validation of subscription permission to create job. - VALIDATE_PREFERENCES = "ValidatePreferences" #: Identify request and response of preference validation. - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" #: Identify request and response of create order limit for subscription validation. - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" #: Identify request and response of active job limit for sku availability. - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" #: Identify request and response of data transfer details validation. - -class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Create order limit validation status. - """ - - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AccessProtocol.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py deleted file mode 100644 index eae813d0281c..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py +++ /dev/null @@ -1,3887 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_name: Name of the account. - :vartype account_name: str - :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_connection_string: Connection string of the account endpoint to use the account - as a storage endpoint on the device. - :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - 'account_name': {'readonly': True}, - 'data_account_type': {'readonly': True}, - 'account_connection_string': {'readonly': True}, - 'share_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, - 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.data_account_type = None - self.account_connection_string = None - self.share_credential_details = None - - -class AdditionalErrorInfo(msrest.serialization.Model): - """Additional error info. - - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(AdditionalErrorInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", - "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", - "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'CloudError'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - self.validation_status = None - self.alternate_addresses = None - - -class ValidationInputResponse(msrest.serialization.Model): - """Minimum properties that should be present in each individual validation response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputResponse, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - - -class AddressValidationProperties(ValidationInputResponse): - """The address validation output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'validation_status': {'key': 'validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.validation_status = None - self.alternate_addresses = None - - -class ApiError(msrest.serialization.Model): - """ApiError. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ApiError, self).__init__(**kwargs) - self.error = kwargs['error'] - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - All required parameters must be populated in order to send to Azure. - - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - - _validation = { - 'transfer_type': {'required': True}, - 'country': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'transfer_type': {'key': 'transferType', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class AzureFileFilterDetails(msrest.serialization.Model): - """Filter details to transfer Azure files. - - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] - """ - - _attribute_map = { - 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, - 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, - 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureFileFilterDetails, self).__init__(**kwargs) - self.file_prefix_list = kwargs.get('file_prefix_list', None) - self.file_path_list = kwargs.get('file_path_list', None) - self.file_share_list = kwargs.get('file_share_list', None) - - -class BlobFilterDetails(msrest.serialization.Model): - """Filter details to transfer Azure Blobs. - - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] - """ - - _attribute_map = { - 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, - 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, - 'container_list': {'key': 'containerList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(BlobFilterDetails, self).__init__(**kwargs) - self.blob_prefix_list = kwargs.get('blob_prefix_list', None) - self.blob_path_list = kwargs.get('blob_path_list', None) - self.container_list = kwargs.get('container_list', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class CloudError(msrest.serialization.Model): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.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, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = None - self.additional_info = None - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _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, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - } - - _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} - } - - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.serialization.Model): - """Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar storage_account_name: Name of the storage account. This will be empty for data account - types other than storage account. - :vartype storage_account_name: str - :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed. - :vartype files_processed: long - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming - conventions which were processed by automatic renaming. - :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: long - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: long - :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. - Until this is true, the TotalBytesToProcess may not be valid. - :vartype is_enumeration_in_progress: bool - """ - - _validation = { - 'storage_account_name': {'readonly': True}, - '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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, - 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, - 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__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(msrest.serialization.Model): - """Minimum request requirement of any validation category. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations. - - All required parameters must be populated in order to send to Azure. - - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - 'validation_category': {'required': True}, - 'individual_request_details': {'required': True}, - } - - _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - } - - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) - self.validation_category = None # type: Optional[str] - self.individual_request_details = kwargs['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. - - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - 'validation_category': {'required': True}, - 'individual_request_details': {'required': True}, - } - - _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' # type: str - - -class ValidationInputRequest(msrest.serialization.Model): - """Minimum fields that must be present in any type of validation request. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.status = None - - -class DataAccountDetails(msrest.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. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - """ - - _validation = { - '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, - **kwargs - ): - super(DataAccountDetails, self).__init__(**kwargs) - self.data_account_type = None # type: Optional[str] - self.share_password = kwargs.get('share_password', None) - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when - LogCollectionLevel is set to Verbose. - :vartype copy_verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, - 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - 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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, - 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.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: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - _subtype_map = { - 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs.get('shipping_address', None) - self.delivery_package = None - self.return_package = None - self.data_import_details = kwargs.get('data_import_details', None) - self.data_export_details = kwargs.get('data_export_details', None) - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type 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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - _subtype_map = { - 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} - } - - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - self.dc_access_security_code = None - self.error = None - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, - 'pass_key': {'key': 'passKey', 'type': 'str'}, - 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the - LogCollectionLevel is set to verbose. - :vartype copy_verbose_log_link: list[str] - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, - 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - self.copy_verbose_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """Databox Heavy Device Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed - for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -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. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'cabinet_pod_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.serialization.Model): - """The secrets related to a databox heavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """Databox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for - TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password - itself. This will not be returned in Get Call. Password Requirements : Password must be - minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, - one number and one special character. Password cannot have the following characters : IilLoO0 - Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a databox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class ScheduleAvailabilityRequest(msrest.serialization.Model): - """Request body to get the availability for scheduling orders. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] - self.sku_name = None # type: Optional[str] - self.country = kwargs.get('country', 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. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' # type: str - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__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(msrest.serialization.Model): - """Details of the data to be used for exporting data from azure. - - All required parameters must be populated in order to send to Azure. - - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - - _validation = { - 'transfer_configuration': {'required': True}, - 'account_details': {'required': True}, - } - - _attribute_map = { - 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, - 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(DataExportDetails, self).__init__(**kwargs) - self.transfer_configuration = kwargs['transfer_configuration'] - self.log_collection_level = kwargs.get('log_collection_level', None) - self.account_details = kwargs['account_details'] - - -class DataImportDetails(msrest.serialization.Model): - """Details of the data to be used for importing data to azure. - - All required parameters must be populated in order to send to Azure. - - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - - _validation = { - 'account_details': {'required': True}, - } - - _attribute_map = { - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(DataImportDetails, self).__init__(**kwargs) - self.account_details = kwargs['account_details'] - - -class DataLocationToServiceLocationMap(msrest.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 - ): - super(DataLocationToServiceLocationMap, self).__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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str - self.data_export_details = kwargs.get('data_export_details', None) - self.data_import_details = kwargs.get('data_import_details', None) - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - - -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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Data transfer details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str - self.status = None - - -class DcAccessSecurityCode(msrest.serialization.Model): - """Dc access security code. - - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str - """ - - _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - - -class Details(msrest.serialization.Model): - """Details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. - :type code: str - :param message: Required. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Details, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['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. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class ErrorDetail(msrest.serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type 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, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.target = kwargs.get('target', None) - - -class FilterFileDetails(msrest.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. - - :param filter_file_type: Required. Type of the filter file. Possible values include: - "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to - transfer. - :type filter_file_path: str - """ - - _validation = { - 'filter_file_type': {'required': True}, - 'filter_file_path': {'required': True}, - } - - _attribute_map = { - 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, - 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterFileDetails, self).__init__(**kwargs) - self.filter_file_type = kwargs['filter_file_type'] - self.filter_file_path = kwargs['filter_file_path'] - - -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' # type: str - - -class JobDeliveryInfo(msrest.serialization.Model): - """Additional delivery info. - - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime - """ - - _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - self.identity = kwargs.get('identity', None) - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: - "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar is_cancellable: Describes whether the job is cancellable or not. - :vartype is_cancellable: bool - :ivar is_deletable: Describes whether the job is deletable or not. - :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. - :vartype is_shipping_address_editable: bool - :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. - :vartype is_prepare_to_ship_enabled: bool - :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :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, - **kwargs - ): - super(JobResource, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - self.transfer_type = kwargs['transfer_type'] - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = kwargs.get('details', None) - self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.is_cancellable_without_fee = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.details = kwargs.get('details', None) - - -class JobStages(msrest.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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object - """ - - _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 - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - - -class KeyEncryptionKey(msrest.serialization.Model): - """Encryption key containing details about key to encrypt different keys. - - All required parameters must be populated in order to send to Azure. - - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed - KekType. - :type kek_vault_resource_id: str - """ - - _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, - **kwargs - ): - super(KeyEncryptionKey, self).__init__(**kwargs) - self.kek_type = kwargs['kek_type'] - self.kek_url = kwargs.get('kek_url', None) - self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) - - -class ManagedDiskDetails(DataAccountDetails): - """Details of the managed disks. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _validation = { - 'data_account_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedDiskDetails, self).__init__(**kwargs) - self.data_account_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type 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, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - """ - - _validation = { - '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, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - self.is_data_action = kwargs.get('is_data_action', None) - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type 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, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _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, - **kwargs - ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.status = None - - -class RegionConfigurationRequest(msrest.serialization.Model): - """Request body to get the configuration for the region. - - :param schedule_availability_request: Request body to get the availability for scheduling - orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given - sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest - """ - - _attribute_map = { - 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, - } - - def __init__( - self, - **kwargs - ): - super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) - - -class RegionConfigurationResponse(msrest.serialization.Model): - """Configuration response specific to a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar schedule_availability_response: Schedule availability for given sku in a region. - :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse - """ - - _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 - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - - -class ResourceIdentity(msrest.serialization.Model): - """Msi identity details of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param type: Identity type. - :type type: str - :ivar principal_id: Service Principal Id backing the Msi. - :vartype principal_id: str - :ivar tenant_id: Home Tenant Id. - :vartype tenant_id: str - """ - - _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, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - - -class ScheduleAvailabilityResponse(msrest.serialization.Model): - """Schedule availability for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) - self.available_dates = None - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _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, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.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 - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type 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, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type 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, - **kwargs - ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.status = None - - -class SkuCapacity(msrest.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 - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - self.multiplier = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar data_location_to_service_location_map: The map of data location to service location. - :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _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 - ): - super(SkuInformation, self).__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. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str - """ - - _validation = { - 'data_account_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageAccountDetails, self).__init__(**kwargs) - self.data_account_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - - -class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): - """Properties of subscription permission to create job validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - self.status = None - - -class TransferAllDetails(msrest.serialization.Model): - """Details to transfer all data. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool - """ - - _validation = { - '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, - **kwargs - ): - super(TransferAllDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) - self.transfer_all_files = kwargs.get('transfer_all_files', None) - - -class TransferConfiguration(msrest.serialization.Model): - """Configuration for defining the transfer of data. - - All required parameters must be populated in order to send to Azure. - - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible - values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is - required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails - """ - - _validation = { - 'transfer_configuration_type': {'required': True}, - } - - _attribute_map = { - 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, - 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, - 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfiguration, self).__init__(**kwargs) - self.transfer_configuration_type = kwargs['transfer_configuration_type'] - self.transfer_filter_details = kwargs.get('transfer_filter_details', None) - self.transfer_all_details = kwargs.get('transfer_all_details', None) - - -class TransferConfigurationTransferAllDetails(msrest.serialization.Model): - """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails - """ - - _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferAllDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) - - -class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): - """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails - """ - - _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) - - -class TransferFilterDetails(msrest.serialization.Model): - """Details of the filtering the transfer of data. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] - """ - - _validation = { - 'data_account_type': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, - 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, - 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferFilterDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.blob_filter_details = kwargs.get('blob_filter_details', None) - self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) - self.filter_file_details = kwargs.get('filter_file_details', None) - - -class TransportAvailabilityDetails(msrest.serialization.Model): - """Transport options availability details for given region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar shipment_type: Transport Shipment Type supported for given region. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'shipment_type': {'readonly': True}, - } - - _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None - - -class TransportAvailabilityRequest(msrest.serialization.Model): - """Request body to get the transport availability for given sku. - - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) - - -class TransportAvailabilityResponse(msrest.serialization.Model): - """Transport options available for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transport_availability_details: List of transport availability details for given region. - :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] - """ - - _validation = { - 'transport_availability_details': {'readonly': True}, - } - - _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) - self.transport_availability_details = None - - -class TransportPreferences(msrest.serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'preferred_shipment_type': {'required': True}, - } - - _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] - - -class UnencryptedCredentials(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.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, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.key_encryption_key = kwargs.get('key_encryption_key', 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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _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, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class ValidationResponse(msrest.serialization.Model): - """Response of pre job creation validations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain validationType and its - response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] - """ - - _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__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/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py index 379d6ab99393..107fb8d66886 100644 --- 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 @@ -1,4 +1,5 @@ # 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. @@ -7,163 +8,176 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +import sys +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from ... import _serialization -from ._data_box_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -class AccountCredentialDetails(msrest.serialization.Model): +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. Possible values include: "StorageAccount", + :ivar data_account_type: Type of the account. Known values are: "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :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.models.ShareCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(AccountCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.account_name = None self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AdditionalErrorInfo(msrest.serialization.Model): +class AdditionalErrorInfo(_serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :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[object] = None, - **kwargs - ): - super(AdditionalErrorInfo, self).__init__(**kwargs) + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", - "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", - "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_04_01.models.ShippingAddress] """ _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, + "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]'}, + "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 - ): - super(AddressValidationOutput, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None self.validation_status = None self.alternate_addresses = None -class ValidationInputResponse(msrest.serialization.Model): +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. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, + DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, + SkuAvailabilityValidationResponseProperties, + SubscriptionIsAllowedToCreateJobValidationResponseProperties Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, + "validation_type": {"required": True}, + "error": {"readonly": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, } _subtype_map = { - 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputResponse, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "AddressValidationProperties", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationResponseProperties", + "ValidateDataTransferDetails": "DataTransferDetailsValidationResponseProperties", + "ValidatePreferences": "PreferencesValidationResponseProperties", + "ValidateSkuAvailability": "SkuAvailabilityValidationResponseProperties", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationResponseProperties", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -175,72 +189,70 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :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}, + "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]'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "validation_status": {"key": "validationStatus", "type": "str"}, + "alternate_addresses": {"key": "alternateAddresses", "type": "[ShippingAddress]"}, } - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str self.validation_status = None self.alternate_addresses = None -class ApiError(msrest.serialization.Model): +class ApiError(_serialization.Model): """ApiError. All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.ErrorDetail """ _validation = { - 'error': {'required': True}, + "error": {"required": True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: "ErrorDetail", - **kwargs - ): - super(ApiError, self).__init__(**kwargs) + def __init__(self, *, error: "_models.ErrorDetail", **kwargs): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2020_04_01.models.ErrorDetail + """ + super().__init__(**kwargs) self.error = error -class ApplianceNetworkConfiguration(msrest.serialization.Model): +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. @@ -252,25 +264,23 @@ class ApplianceNetworkConfiguration(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, + "name": {"readonly": True}, + "mac_address": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "mac_address": {"key": "macAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(msrest.serialization.Model): +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. @@ -284,120 +294,132 @@ class ArmBaseObject(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, + "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'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(msrest.serialization.Model): +class AvailableSkuRequest(_serialization.Model): """The filters for showing the available skus. All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + 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}, + "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]'}, + "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, "TransferType"], + transfer_type: Union[str, "_models.TransferType"], country: str, location: str, - sku_names: Optional[List[Union[str, "SkuName"]]] = None, + sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, **kwargs ): - super(AvailableSkuRequest, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class AvailableSkusResult(_serialization.Model): """The available skus operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SkuInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class AzureFileFilterDetails(_serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :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]'}, + "file_prefix_list": {"key": "filePrefixList", "type": "[str]"}, + "file_path_list": {"key": "filePathList", "type": "[str]"}, + "file_share_list": {"key": "fileShareList", "type": "[str]"}, } def __init__( @@ -408,27 +430,35 @@ def __init__( file_share_list: Optional[List[str]] = None, **kwargs ): - super(AzureFileFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class BlobFilterDetails(_serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :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]'}, + "blob_prefix_list": {"key": "blobPrefixList", "type": "[str]"}, + "blob_path_list": {"key": "blobPathList", "type": "[str]"}, + "container_list": {"key": "containerList", "type": "[str]"}, } def __init__( @@ -439,78 +469,88 @@ def __init__( container_list: Optional[List[str]] = None, **kwargs ): - super(BlobFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class CancellationReason(_serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs): + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason -class CloudError(msrest.serialization.Model): +class CloudError(_serialization.Model): """Cloud error. Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :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.models.CloudError] + :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.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2020_04_01.models.AdditionalErrorInfo] """ _validation = { - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "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]'}, + "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 + self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs ): - super(CloudError, self).__init__(**kwargs) + """ + :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 @@ -518,38 +558,39 @@ def __init__( self.additional_info = None -class ContactDetails(msrest.serialization.Model): +class ContactDetails(_serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :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}, + "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]'}, + "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__( @@ -560,10 +601,25 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - notification_preference: Optional[List["NotificationPreference"]] = None, + notification_preference: Optional[List["_models.NotificationPreference"]] = None, **kwargs ): - super(ContactDetails, self).__init__(**kwargs) + """ + :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 @@ -572,40 +628,43 @@ def __init__( self.notification_preference = notification_preference -class CopyLogDetails(msrest.serialization.Model): +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. + 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. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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}, + "copy_log_details_type": {"required": True}, } _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, } _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} + "copy_log_details_type": { + "DataBox": "DataBoxAccountCopyLogDetails", + "DataBoxDisk": "DataBoxDiskCopyLogDetails", + "DataBoxHeavy": "DataBoxHeavyAccountCopyLogDetails", + } } - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(msrest.serialization.Model): +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. @@ -613,83 +672,81 @@ class CopyProgress(msrest.serialization.Model): :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. Possible values include: "ImportToAzure", + :ivar transfer_type: Transfer type of data. Known values are: "ImportToAzure" and "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + :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.models.DataAccountType + :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: long + :vartype bytes_processed: int :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long + :vartype total_bytes_to_process: int :ivar files_processed: Number of files processed. - :vartype files_processed: long + :vartype files_processed: int :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: long + :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: long + :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: long + :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: long + :vartype renamed_container_count: int :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long + :vartype files_errored_out: int :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: long + :vartype directories_errored_out: int :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: long + :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}, + "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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, - 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, - 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__init__(**kwargs) + "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): + """ """ + super().__init__(**kwargs) self.storage_account_name = None self.transfer_type = None self.data_account_type = None @@ -707,43 +764,43 @@ def __init__( self.is_enumeration_in_progress = None -class ValidationRequest(msrest.serialization.Model): +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. + 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. - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :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}, + "validation_category": {"required": True}, + "individual_request_details": {"required": True}, } _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + "validation_category": {"key": "validationCategory", "type": "str"}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, } - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } + _subtype_map = {"validation_category": {"JobCreationValidation": "CreateJobValidations"}} - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = None # type: Optional[str] self.individual_request_details = individual_request_details @@ -753,66 +810,75 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :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}, + "validation_category": {"required": True}, + "individual_request_details": {"required": True}, } _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + "validation_category": {"key": "validationCategory", "type": "str"}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, } - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category = 'JobCreationValidation' # type: str + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = "JobCreationValidation" # type: str -class ValidationInputRequest(msrest.serialization.Model): +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. + 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. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "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 - ): - super(ValidationInputRequest, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "ValidateAddress", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationRequest", + "ValidateDataTransferDetails": "DataTransferDetailsValidationRequest", + "ValidatePreferences": "PreferencesValidationRequest", + "ValidateSkuAvailability": "SkuAvailabilityValidationRequest", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationRequest", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -821,34 +887,34 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :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}, + "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, "SkuName"], - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + "validation_type": {"key": "validationType", "type": "str"}, + "device_type": {"key": "deviceType", "type": "str"}, + } + + def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs): + """ + :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 = "ValidateCreateOrderLimit" # type: str self.device_type = device_type @@ -859,79 +925,81 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str self.status = None -class DataAccountDetails(msrest.serialization.Model): +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. + 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. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { - 'data_account_type': {'required': True}, + "data_account_type": {"required": True}, } _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, + "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 - ): - super(DataAccountDetails, self).__init__(**kwargs) + "data_account_type": {"ManagedDisk": "ManagedDiskDetails", "StorageAccount": "StorageAccountDetails"} + } + + def __init__(self, *, share_password: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.share_password = share_password @@ -943,9 +1011,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -956,25 +1025,23 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str self.account_name = None self.copy_log_link = None self.copy_verbose_log_link = None @@ -987,9 +1054,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -999,31 +1067,29 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None -class DataBoxDiskCopyProgress(msrest.serialization.Model): +class DataBoxDiskCopyProgress(_serialization.Model): """DataBox Disk Copy Progress. Variables are only populated by the server, and will be ignored when sending a request. @@ -1031,127 +1097,145 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long + :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. Possible values include: "NotStarted", "InProgress", + :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + "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}, + "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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, + "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 - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.serial_number = None self.bytes_copied = None self.percent_complete = None self.status = None -class JobDetails(msrest.serialization.Model): +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. + 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + "job_stages": {"key": "jobStages", "type": "[JobStages]"}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, + "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, + "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'} + "job_details_type": { + "DataBox": "DataBoxJobDetails", + "DataBoxDisk": "DataBoxDiskJobDetails", + "DataBoxHeavy": "DataBoxHeavyJobDetails", + } } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(JobDetails, self).__init__(**kwargs) + """ + :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 @@ -1165,10 +1249,10 @@ def __init__( self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None self.key_encryption_key = None - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes -class DataBoxDiskJobDetails(JobDetails): +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. @@ -1176,144 +1260,175 @@ class DataBoxDiskJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :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. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :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] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBoxDisk' # type: str + """ + :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 = "DataBoxDisk" # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey -class JobSecrets(msrest.serialization.Model): +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. + 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. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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}, + "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'}, + "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'} + "job_secrets_type": { + "DataBox": "DataboxJobSecrets", + "DataBoxDisk": "DataBoxDiskJobSecrets", + "DataBoxHeavy": "DataBoxHeavyJobSecrets", + } } - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None self.error = None @@ -1326,15 +1441,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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.models.DiskSecret] + :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. @@ -1342,29 +1457,27 @@ class DataBoxDiskJobSecrets(JobSecrets): """ _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, + "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 - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str + "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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None @@ -1377,9 +1490,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -1390,31 +1504,29 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, + "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]'}, + "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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str self.account_name = None self.copy_log_link = None self.copy_verbose_log_link = None -class DataBoxHeavyJobDetails(JobDetails): +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. @@ -1422,92 +1534,122 @@ class DataBoxHeavyJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :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 : @#-$%^!+=;:_()]+. - :type device_password: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str + """ + :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 = "DataBoxHeavy" # type: str self.copy_progress = None self.device_password = device_password @@ -1519,41 +1661,39 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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.models.DataBoxHeavySecret] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str self.cabinet_pod_secrets = None -class DataBoxHeavySecret(msrest.serialization.Model): +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. @@ -1563,35 +1703,35 @@ class DataBoxHeavySecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1599,7 +1739,7 @@ def __init__( self.account_credential_details = None -class DataBoxJobDetails(JobDetails): +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. @@ -1607,92 +1747,122 @@ class DataBoxJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :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 : @#-$%^!+=;:_()]+. - :type device_password: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBox' # type: str + """ + :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 = "DataBox" # type: str self.copy_progress = None self.device_password = device_password @@ -1704,82 +1874,89 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :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}, + "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["DataBoxSecret"]] = None, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str + "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): + """ + :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 = "DataBox" # type: str self.pod_secrets = pod_secrets -class ScheduleAvailabilityRequest(msrest.serialization.Model): +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. + 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. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) + "sku_name": { + "DataBox": "DataBoxScheduleAvailabilityRequest", + "DataBoxDisk": "DiskScheduleAvailabilityRequest", + "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", + } + } + + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.country = country @@ -1790,39 +1967,42 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBox' # type: str + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = "DataBox" # type: str -class DataBoxSecret(msrest.serialization.Model): +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. @@ -1832,35 +2012,35 @@ class DataBoxSecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1868,73 +2048,82 @@ def __init__( self.account_credential_details = None -class DataExportDetails(msrest.serialization.Model): +class DataExportDetails(_serialization.Model): """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :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}, + "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'}, + "transfer_configuration": {"key": "transferConfiguration", "type": "TransferConfiguration"}, + "log_collection_level": {"key": "logCollectionLevel", "type": "str"}, + "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, } def __init__( self, *, - transfer_configuration: "TransferConfiguration", - account_details: "DataAccountDetails", - log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + transfer_configuration: "_models.TransferConfiguration", + account_details: "_models.DataAccountDetails", + log_collection_level: Union[str, "_models.LogCollectionLevel"] = "Error", **kwargs ): - super(DataExportDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :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}, + "account_details": {"required": True}, } _attribute_map = { - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, + "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, } - def __init__( - self, - *, - account_details: "DataAccountDetails", - **kwargs - ): - super(DataImportDetails, self).__init__(**kwargs) + def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs): + """ + :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(msrest.serialization.Model): +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. @@ -1946,20 +2135,18 @@ class DataLocationToServiceLocationMap(msrest.serialization.Model): """ _validation = { - 'data_location': {'readonly': True}, - 'service_location': {'readonly': True}, + "data_location": {"readonly": True}, + "service_location": {"readonly": True}, } _attribute_map = { - 'data_location': {'key': 'dataLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + "data_location": {"key": "dataLocation", "type": "str"}, + "service_location": {"key": "serviceLocation", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.data_location = None self.service_location = None @@ -1969,48 +2156,61 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :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". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :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". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :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}, + "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'}, + "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, "SkuName"], - transfer_type: Union[str, "TransferType"], - data_export_details: Optional[List["DataExportDetails"]] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, + 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 ): - super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str + """ + :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 = "ValidateDataTransferDetails" # type: str self.data_export_details = data_export_details self.data_import_details = data_import_details self.device_type = device_type @@ -2024,94 +2224,94 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Data transfer details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str self.status = None -class DcAccessSecurityCode(msrest.serialization.Model): +class DcAccessSecurityCode(_serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :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'}, + "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 + self, *, reverse_dc_access_code: Optional[str] = None, forward_dc_access_code: Optional[str] = None, **kwargs ): - super(DcAccessSecurityCode, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Details(_serialization.Model): """Details. All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "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 - ): - super(Details, self).__init__(**kwargs) + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, code: str, message: str, **kwargs): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ + super().__init__(**kwargs) self.code = code self.message = message @@ -2121,46 +2321,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + 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_terabytes': {'required': True}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + "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_terabytes: int, - country: Optional[str] = None, - **kwargs + self, *, storage_location: str, expected_data_size_in_tera_bytes: int, country: Optional[str] = None, **kwargs ): - super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes - - -class DiskSecret(msrest.serialization.Model): + """ + :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 = "DataBoxDisk" # type: str + 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. @@ -2173,49 +2380,47 @@ class DiskSecret(msrest.serialization.Model): """ _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, + "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'}, + "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, + "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class ErrorDetail(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """ErrorDetail. All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :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}, + "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'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[Details]"}, + "target": {"key": "target", "type": "str"}, } def __init__( @@ -2223,48 +2428,60 @@ def __init__( *, code: str, message: str, - details: Optional[List["Details"]] = None, + details: Optional[List["_models.Details"]] = None, target: Optional[str] = None, **kwargs ): - super(ErrorDetail, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param filter_file_type: Required. Type of the filter file. Possible values include: - "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to - transfer. - :type filter_file_path: str + :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}, + "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, "FilterFileType"], - filter_file_path: str, - **kwargs - ): - super(FilterFileDetails, self).__init__(**kwargs) + "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): + """ + :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 @@ -2274,134 +2491,150 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBoxHeavy' # type: str + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = "DataBoxHeavy" # type: str -class JobDeliveryInfo(msrest.serialization.Model): +class JobDeliveryInfo(_serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + "scheduled_date_time": {"key": "scheduledDateTime", "type": "iso-8601"}, } - def __init__( - self, - *, - scheduled_date_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) + def __init__(self, *, scheduled_date_time: Optional[datetime.datetime] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class Resource(_serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :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}, + "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'}, + "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: "Sku", + sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, - identity: Optional["ResourceIdentity"] = None, + identity: Optional["_models.ResourceIdentity"] = None, **kwargs ): - super(Resource, self).__init__(**kwargs) + """ + :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): +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. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :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 - :param transfer_type: Required. Type of the data transfer. Possible values include: - "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :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. @@ -2410,84 +2643,106 @@ class JobResource(Resource): :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. Possible values include: "DeviceOrdered", + :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". - :vartype status: str or ~azure.mgmt.databox.models.StageName + "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.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~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 - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar 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}, + "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'}, + "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: "Sku", - transfer_type: Union[str, "TransferType"], + sku: "_models.Sku", + transfer_type: Union[str, "_models.TransferType"], tags: Optional[Dict[str, str]] = None, - identity: Optional["ResourceIdentity"] = None, - details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, - delivery_info: Optional["JobDeliveryInfo"] = 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 ): - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) + """ + :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 @@ -2506,108 +2761,117 @@ def __init__( self.is_cancellable_without_fee = None -class JobResourceList(msrest.serialization.Model): +class JobResourceList(_serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["JobResource"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs ): - super(JobResourceList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class JobResourceUpdateParameter(_serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :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'}, + "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["ResourceIdentity"] = None, - details: Optional["UpdateJobDetails"] = None, + identity: Optional["_models.ResourceIdentity"] = None, + details: Optional["_models.UpdateJobDetails"] = None, **kwargs ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + :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". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + "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. Possible values include: "None", "InProgress", + :ivar stage_status: Status of the job stage. Known values are: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + "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: object + :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}, + "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'}, + "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 - ): - super(JobStages, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None @@ -2615,40 +2879,50 @@ def __init__( self.job_stage_details = None -class KeyEncryptionKey(msrest.serialization.Model): +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. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :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. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { - 'kek_type': {'required': True}, + "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'}, + "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, "KekType"], + kek_type: Union[str, "_models.KekType"] = "MicrosoftManaged", kek_url: Optional[str] = None, kek_vault_resource_id: Optional[str] = None, **kwargs ): - super(KeyEncryptionKey, self).__init__(**kwargs) + """ + :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 @@ -2659,85 +2933,97 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :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}, + "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'}, + "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 + self, *, resource_group_id: str, staging_storage_account_id: str, share_password: Optional[str] = None, **kwargs ): - super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) - self.data_account_type = 'ManagedDisk' # type: str + """ + :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 = "ManagedDisk" # type: str self.resource_group_id = resource_group_id self.staging_storage_account_id = staging_storage_account_id -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :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}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool = True, **kwargs ): - super(NotificationPreference, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Operation(_serialization.Model): """Operation entity. Variables are only populated by the server, and will be ignored when sending a request. @@ -2746,37 +3032,36 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2020_04_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: JSON :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :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}, + "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 - ): - super(Operation, self).__init__(**kwargs) + "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): + """ + :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 @@ -2784,24 +3069,24 @@ def __init__( self.is_data_action = is_data_action -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :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'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -2813,45 +3098,54 @@ def __init__( description: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class OperationList(_serialization.Model): """Operation Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class PackageShippingDetails(_serialization.Model): """Shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2865,49 +3159,53 @@ class PackageShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "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'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :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'}, + "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["TransportPreferences"] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, **kwargs ): - super(Preferences, self).__init__(**kwargs) + """ + :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 @@ -2917,38 +3215,45 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "preference": {"key": "preference", "type": "Preferences"}, + "device_type": {"key": "deviceType", "type": "str"}, } def __init__( self, *, - device_type: Union[str, "SkuName"], - preference: Optional["Preferences"] = None, + device_type: Union[str, "_models.SkuName"], + preference: Optional["_models.Preferences"] = None, **kwargs ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + """ + :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 = "ValidatePreferences" # type: str self.preference = preference self.device_type = device_type @@ -2960,106 +3265,123 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str self.status = None -class RegionConfigurationRequest(msrest.serialization.Model): +class RegionConfigurationRequest(_serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :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. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :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'}, + "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, + "transport_availability_request": { + "key": "transportAvailabilityRequest", + "type": "TransportAvailabilityRequest", + }, } def __init__( self, *, - schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["TransportAvailabilityRequest"] = None, + schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, **kwargs ): - super(RegionConfigurationRequest, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class RegionConfigurationResponse(_serialization.Model): """Configuration response specific to a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~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.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityResponse """ _validation = { - 'schedule_availability_response': {'readonly': True}, - 'transport_availability_response': {'readonly': True}, + "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 - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) + "schedule_availability_response": { + "key": "scheduleAvailabilityResponse", + "type": "ScheduleAvailabilityResponse", + }, + "transport_availability_response": { + "key": "transportAvailabilityResponse", + "type": "TransportAvailabilityResponse", + }, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ResourceIdentity(msrest.serialization.Model): +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. - :param type: Identity type. - :type type: str + :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. @@ -3067,29 +3389,28 @@ class ResourceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "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'}, + "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 - ): - super(ResourceIdentity, self).__init__(**kwargs) + def __init__(self, *, type: Optional[str] = None, **kwargs): + """ + :keyword type: Identity type. + :paramtype type: str + """ + super().__init__(**kwargs) self.type = type self.principal_id = None self.tenant_id = None -class ScheduleAvailabilityResponse(msrest.serialization.Model): +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. @@ -3099,60 +3420,57 @@ class ScheduleAvailabilityResponse(msrest.serialization.Model): """ _validation = { - 'available_dates': {'readonly': True}, + "available_dates": {"readonly": True}, } _attribute_map = { - 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, + "available_dates": {"key": "availableDates", "type": "[iso-8601]"}, } - def __init__( - self, - **kwargs - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(msrest.serialization.Model): +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. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :ivar share_type: Type of the share. 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.models.AccessProtocol] + :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}, + "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]'}, + "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 - ): - super(ShareCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.share_name = None self.share_type = None self.user_name = None @@ -3160,48 +3478,51 @@ def __init__( self.supported_access_protocols = None -class ShipmentPickUpRequest(msrest.serialization.Model): +class ShipmentPickUpRequest(_serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :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}, + "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 - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) + "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): + """ + :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(msrest.serialization.Model): +class ShipmentPickUpResponse(_serialization.Model): """Shipment pick up response. Variables are only populated by the server, and will be ignored when sending a request. @@ -3214,69 +3535,66 @@ class ShipmentPickUpResponse(msrest.serialization.Model): """ _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, + "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'}, + "confirmation_number": {"key": "confirmationNumber", "type": "str"}, + "ready_by_time": {"key": "readyByTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(msrest.serialization.Model): +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. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :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}, + "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'}, + "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__( @@ -3291,10 +3609,33 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Union[str, "_models.AddressType"] = "None", **kwargs ): - super(ShippingAddress, self).__init__(**kwargs) + """ + :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 @@ -3307,39 +3648,48 @@ def __init__( self.address_type = address_type -class Sku(msrest.serialization.Model): +class Sku(_serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :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}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "family": {"key": "family", "type": "str"}, } def __init__( self, *, - name: Union[str, "SkuName"], + name: Union[str, "_models.SkuName"], display_name: Optional[str] = None, family: Optional[str] = None, **kwargs ): - super(Sku, self).__init__(**kwargs) + """ + :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 @@ -3350,52 +3700,68 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :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". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str + Required. + :vartype location: str """ _validation = { - 'validation_type': {'required': True}, - 'device_type': {'required': True}, - 'transfer_type': {'required': True}, - 'country': {'required': True}, - 'location': {'required': True}, + "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'}, + "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, "SkuName"], - transfer_type: Union[str, "TransferType"], + device_type: Union[str, "_models.SkuName"], + transfer_type: Union[str, "_models.TransferType"], country: str, location: str, **kwargs ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + """ + :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 = "ValidateSkuAvailability" # type: str self.device_type = device_type self.transfer_type = transfer_type self.country = country @@ -3409,40 +3775,38 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + :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.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str self.status = None -class SkuCapacity(msrest.serialization.Model): +class SkuCapacity(_serialization.Model): """Capacity of the sku. Variables are only populated by the server, and will be ignored when sending a request. @@ -3454,25 +3818,23 @@ class SkuCapacity(msrest.serialization.Model): """ _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, + "usable": {"readonly": True}, + "maximum": {"readonly": True}, } _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, + "usable": {"key": "usable", "type": "str"}, + "maximum": {"key": "maximum", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(msrest.serialization.Model): +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. @@ -3488,48 +3850,46 @@ class SkuCost(msrest.serialization.Model): """ _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, - 'multiplier': {'readonly': True}, + "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'}, + "meter_id": {"key": "meterId", "type": "str"}, + "meter_type": {"key": "meterType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, } - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.meter_id = None self.meter_type = None self.multiplier = None -class SkuInformation(msrest.serialization.Model): +class SkuInformation(_serialization.Model): """Information of the sku. Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :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.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2020_04_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2020_04_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :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. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. 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. @@ -3537,34 +3897,35 @@ class SkuInformation(msrest.serialization.Model): """ _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}, + "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 - ): - super(SkuInformation, self).__init__(**kwargs) + "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): + """ """ + super().__init__(**kwargs) self.sku = None self.enabled = None self.data_location_to_service_location_map = None @@ -3581,40 +3942,45 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :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}, + "data_account_type": {"required": True}, + "storage_account_id": {"required": True}, } _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - *, - storage_account_id: str, - share_password: Optional[str] = None, - **kwargs - ): - super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) - self.data_account_type = 'StorageAccount' # type: str + "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): + """ + :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 = "StorageAccount" # type: str self.storage_account_id = storage_account_id @@ -3623,27 +3989,25 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "validation_type": {"key": "validationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): @@ -3653,306 +4017,344 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str self.status = None -class TransferAllDetails(msrest.serialization.Model): +class TransferAllDetails(_serialization.Model): """Details to transfer all data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :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}, + "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'}, + "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, "DataAccountType"], + data_account_type: Union[str, "_models.DataAccountType"], transfer_all_blobs: Optional[bool] = None, transfer_all_files: Optional[bool] = None, **kwargs ): - super(TransferAllDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class TransferConfiguration(_serialization.Model): """Configuration for defining the transfer of data. All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible - values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :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. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :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}, + "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'}, + "transfer_configuration_type": {"key": "transferConfigurationType", "type": "str"}, + "transfer_filter_details": { + "key": "transferFilterDetails", + "type": "TransferConfigurationTransferFilterDetails", + }, + "transfer_all_details": {"key": "transferAllDetails", "type": "TransferConfigurationTransferAllDetails"}, } def __init__( self, *, - transfer_configuration_type: Union[str, "TransferConfigurationType"], - transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, - transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, + transfer_configuration_type: Union[str, "_models.TransferConfigurationType"], + transfer_filter_details: Optional["_models.TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["_models.TransferConfigurationTransferAllDetails"] = None, **kwargs ): - super(TransferConfiguration, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2020_04_01.models.TransferAllDetails """ _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + "include": {"key": "include", "type": "TransferAllDetails"}, } - def __init__( - self, - *, - include: Optional["TransferAllDetails"] = None, - **kwargs - ): - super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + def __init__(self, *, include: Optional["_models.TransferAllDetails"] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :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'}, + "include": {"key": "include", "type": "TransferFilterDetails"}, } - def __init__( - self, - *, - include: Optional["TransferFilterDetails"] = None, - **kwargs - ): - super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + def __init__(self, *, include: Optional["_models.TransferFilterDetails"] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class TransferFilterDetails(_serialization.Model): """Details of the filtering the transfer of data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :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}, + "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]'}, + "data_account_type": {"key": "dataAccountType", "type": "str"}, + "blob_filter_details": {"key": "blobFilterDetails", "type": "BlobFilterDetails"}, + "azure_file_filter_details": {"key": "azureFileFilterDetails", "type": "AzureFileFilterDetails"}, + "filter_file_details": {"key": "filterFileDetails", "type": "[FilterFileDetails]"}, } def __init__( self, *, - data_account_type: Union[str, "DataAccountType"], - blob_filter_details: Optional["BlobFilterDetails"] = None, - azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, - filter_file_details: Optional[List["FilterFileDetails"]] = None, + 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 ): - super(TransferFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "shipment_type": {"readonly": True}, } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + "shipment_type": {"key": "shipmentType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.shipment_type = None -class TransportAvailabilityRequest(msrest.serialization.Model): +class TransportAvailabilityRequest(_serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "sku_name": {"key": "skuName", "type": "str"}, } - def __init__( - self, - *, - sku_name: Optional[Union[str, "SkuName"]] = None, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) + def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class TransportAvailabilityResponse(_serialization.Model): """Transport options available for given sku in a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityDetails] """ _validation = { - 'transport_availability_details': {'readonly': True}, + "transport_availability_details": {"readonly": True}, } _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, + "transport_availability_details": { + "key": "transportAvailabilityDetails", + "type": "[TransportAvailabilityDetails]", + }, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(msrest.serialization.Model): +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. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "preferred_shipment_type": {"required": True}, } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, } - def __init__( - self, - *, - preferred_shipment_type: Union[str, "TransportShipmentTypes"], - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs): + """ + :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(msrest.serialization.Model): +class UnencryptedCredentials(_serialization.Model): """Unencrypted credentials for accessing device. Variables are only populated by the server, and will be ignored when sending a request. @@ -3960,80 +4362,92 @@ class UnencryptedCredentials(msrest.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.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2020_04_01.models.JobSecrets """ _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, + "job_name": {"readonly": True}, + "job_secrets": {"readonly": True}, } _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, + "job_name": {"key": "jobName", "type": "str"}, + "job_secrets": {"key": "jobSecrets", "type": "JobSecrets"}, } - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_name = None self.job_secrets = None -class UnencryptedCredentialsList(msrest.serialization.Model): +class UnencryptedCredentialsList(_serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[UnencryptedCredentials]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["UnencryptedCredentials"]] = None, + value: Optional[List["_models.UnencryptedCredentials"]] = None, next_link: Optional[str] = None, **kwargs ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class UpdateJobDetails(_serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :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'}, + "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["ContactDetails"] = None, - shipping_address: Optional["ShippingAddress"] = None, - key_encryption_key: Optional["KeyEncryptionKey"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, **kwargs ): - super(UpdateJobDetails, self).__init__(**kwargs) + """ + :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 @@ -4044,75 +4458,86 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :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}, + "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'}, + "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: "ShippingAddress", - device_type: Union[str, "SkuName"], - transport_preferences: Optional["TransportPreferences"] = None, + shipping_address: "_models.ShippingAddress", + device_type: Union[str, "_models.SkuName"], + transport_preferences: Optional["_models.TransportPreferences"] = None, **kwargs ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + """ + :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 = "ValidateAddress" # type: str self.shipping_address = shipping_address self.device_type = device_type self.transport_preferences = transport_preferences -class ValidationResponse(msrest.serialization.Model): +class ValidationResponse(_serialization.Model): """Response of pre job creation validations. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :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.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputResponse] """ _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, + "status": {"readonly": True}, + "individual_response_details": {"readonly": True}, } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, + "status": {"key": "properties.status", "type": "str"}, + "individual_response_details": { + "key": "properties.individualResponseDetails", + "type": "[ValidationInputResponse]", + }, } - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index f6529e974c09..748ee8e5b189 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,99 +6,395 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + accept = _headers.pop("Accept", "application/json") -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + # 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 = _format_url_section(_url, **path_format_arguments) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -class JobsOperations(object): - """JobsOperations operations. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. +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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,76 +403,80 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -184,658 +485,997 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def get( - self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _create_initial( - self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._create_initial( + raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - def _delete_initial( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - def begin_delete( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._update_initial( + raw_result = self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :param shipment_pick_up_request: Details of shipment pick up request. Is either a model 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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ShipmentPickUpResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -844,17 +1484,18 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index 85d48f01c117..9a223b2cd38e 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,87 +6,122 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 + -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + accept = _headers.pop("Accept", "application/json") -class Operations(object): - """Operations operations. + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + 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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,17 +130,18 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 409bd7a9a99d..33781f86df8e 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,111 +6,385 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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) -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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 {}) -class ServiceOperations(object): - """ServiceOperations operations. + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # 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"), + } - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,349 +393,666 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :param validate_address: Shipping address of the customer. Is either a model 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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :return: AddressValidationOutput or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore + + @overload def region_configuration_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :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. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 index ae972ed54f84..c3f328be41df 100644 --- 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 @@ -10,10 +10,15 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['DataBoxManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import except ImportError: - pass + _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 index 10fdfd792e62..006f73d13355 100644 --- 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 @@ -6,66 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Subscription Id. + :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, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2020-11-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-11-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index e696cb06a780..e0346389aeaa 100644 --- 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 @@ -6,65 +6,85 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import 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 typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_11_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_11_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations - :param credential: Credential needed for the client to connect to Azure. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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 + """ - 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) + 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): # type: () -> None 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 index add87dd6b287..7a8a6bd8c350 100644 --- 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 @@ -5,59 +5,100 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "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, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "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, # type: str", - "description": "The Subscription Id.", + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", "docstring_type": "str", "required": true } }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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": "None", - "async_imports": "None" + } } \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..9aad73fc743e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = 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 index eae7c95b6fbd..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" 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 index bb6b75a72db8..e9ac07d95558 100644 --- 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 @@ -7,4 +7,15 @@ # -------------------------------------------------------------------------- from ._data_box_management_client import DataBoxManagementClient -__all__ = ['DataBoxManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # 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 index 9287b4a36561..3a62434c9ab1 100644 --- 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 @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,49 +19,48 @@ from azure.core.credentials_async import AsyncTokenCredential -class DataBoxManagementClientConfiguration(Configuration): +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. + :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. + :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: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2020-11-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-11-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', '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._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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + 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 index b192ff7cd771..9e7f60a96067 100644 --- 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 @@ -6,62 +6,85 @@ # 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 azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import 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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - -class DataBoxManagementClient(object): +class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_11_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_11_01.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. + :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. + :param subscription_id: The Subscription Id. Required. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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 + """ - 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) + 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() 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index 37298e86749d..958ae92fd5f2 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,94 +6,119 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """JobsOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,75 +127,81 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobResourceList"]: + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -178,648 +210,997 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + + @distributed_trace_async async def get( - self, - resource_group_name: str, - job_name: str, - expand: Optional[str] = None, - **kwargs - ) -> "_models.JobResource": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _create_initial( - self, - resource_group_name: str, - job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_create( self, resource_group_name: str, job_name: str, - job_resource: "_models.JobResource", - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_initial( + raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - async def _delete_initial( - self, - resource_group_name: str, - job_name: str, - **kwargs + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - async def begin_delete( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncLROPoller[None]: + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore async def _update_initial( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: Union[_models.JobResourceUpdateParameter, IO], if_match: Optional[str] = None, - **kwargs - ) -> Optional["_models.JobResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + **kwargs: Any + ) -> Optional[_models.JobResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload async def begin_update( self, resource_group_name: str, job_name: str, - job_resource_update_parameter: "_models.JobResourceUpdateParameter", + job_resource_update_parameter: _models.JobResourceUpdateParameter, if_match: Optional[str] = None, - **kwargs - ) -> AsyncLROPoller["_models.JobResource"]: + *, + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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: "_models.ShipmentPickUpRequest", - **kwargs - ) -> "_models.ShipmentPickUpResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - async def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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: "_models.CancellationReason", - **kwargs + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any ) -> None: """CancelJob. - :param resource_group_name: The Resource Group Name. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name: str, - job_name: str, - **kwargs - ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -828,17 +1209,18 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/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 index e59616bb0771..7e689491e1ca 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,82 +6,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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') +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: - """Operations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationList"]: + @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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,17 +109,18 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index f15eb76d17f1..f43696060fd0 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,106 +6,198 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, HttpRequest +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 - -T = TypeVar('T') +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: - """ServiceOperations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class ServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + 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, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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: "_models.AvailableSkuRequest", - **kwargs - ) -> AsyncIterable["_models.AvailableSkusResult"]: + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,344 +206,666 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload async def validate_address( self, location: str, - validate_address: "_models.ValidateAddress", - **kwargs - ) -> "_models.AddressValidationOutput": + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :param validate_address: Shipping address of the customer. Is either a model 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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :return: AddressValidationOutput or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :param validation_request: Inputs of the customer. Is either a model 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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ValidationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def validate_inputs( self, location: str, - validation_request: "_models.ValidationRequest", - **kwargs - ) -> "_models.ValidationResponse": + 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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :param validation_request: Inputs of the customer. Is either a model 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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ValidationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload async def region_configuration( self, location: str, - region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs - ) -> "_models.RegionConfigurationResponse": + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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 model 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: RegionConfigurationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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: "_models.RegionConfigurationRequest", - **kwargs - ) -> "_models.RegionConfigurationResponse": + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :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. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + resource group level. Is either a model 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: RegionConfigurationResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 index 14f8f8c755cb..680433af96e9 100644 --- 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 @@ -6,363 +6,264 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AccountCredentialDetails - from ._models_py3 import AdditionalErrorInfo - from ._models_py3 import AddressValidationOutput - from ._models_py3 import AddressValidationProperties - from ._models_py3 import ApiError - from ._models_py3 import ApplianceNetworkConfiguration - from ._models_py3 import ArmBaseObject - from ._models_py3 import AvailableSkuRequest - from ._models_py3 import AvailableSkusResult - from ._models_py3 import AzureFileFilterDetails - from ._models_py3 import BlobFilterDetails - from ._models_py3 import CancellationReason - from ._models_py3 import CloudError - from ._models_py3 import ContactDetails - from ._models_py3 import CopyLogDetails - from ._models_py3 import CopyProgress - from ._models_py3 import CreateJobValidations - from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest - from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties - from ._models_py3 import DataAccountDetails - from ._models_py3 import DataBoxAccountCopyLogDetails - from ._models_py3 import DataBoxDiskCopyLogDetails - from ._models_py3 import DataBoxDiskCopyProgress - 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 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AdditionalErrorInfo # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApiError # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import AzureFileFilterDetails # type: ignore - from ._models import BlobFilterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataAccountDetails # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataExportDetails # type: ignore - from ._models import DataImportDetails # type: ignore - from ._models import DataLocationToServiceLocationMap # type: ignore - from ._models import DataTransferDetailsValidationRequest # type: ignore - from ._models import DataTransferDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import Details # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import EncryptionPreferences # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import FilterFileDetails # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import IdentityProperties # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import KeyEncryptionKey # type: ignore - from ._models import ManagedDiskDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransferAllDetails # type: ignore - from ._models import TransferConfiguration # type: ignore - from ._models import TransferConfigurationTransferAllDetails # type: ignore - from ._models import TransferConfigurationTransferFilterDetails # type: ignore - from ._models import TransferFilterDetails # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserAssignedProperties # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +from ._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, - AddressType, - AddressValidationStatus, - ClassDiscriminator, - CopyStatus, - DataAccountType, - DoubleEncryption, - FilterFileType, - JobDeliveryType, - KekType, - LogCollectionLevel, - NotificationStageName, - OverallValidationStatus, - ShareDestinationFormatType, - SkuDisabledReason, - SkuName, - StageName, - StageStatus, - TransferConfigurationType, - TransferType, - TransportShipmentTypes, - ValidationInputDiscriminator, - ValidationStatus, -) +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 * # type: ignore # 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', - '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', + "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 index 7d1d81567b85..903d43960403 100644 --- 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 @@ -6,232 +6,317 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. - -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The address validation status. - """ - - VALID = "Valid" #: Address provided is valid. - INVALID = "Invalid" #: Address provided is invalid or not supported. - AMBIGUOUS = "Ambiguous" #: Address provided is ambiguous, please choose one of the alternate addresses returned. - -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates the type of job details. - """ - - DATA_BOX = "DataBox" #: Data Box orders. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy orders. - -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Status of the copy - """ - - NOT_STARTED = "NotStarted" #: Data copy hasn't started yet. - IN_PROGRESS = "InProgress" #: Data copy is in progress. - COMPLETED = "Completed" #: Data copy completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Data copy completed with errors. - FAILED = "Failed" #: Data copy failed. No data was copied. - NOT_RETURNED = "NotReturned" #: No copy triggered as device was not returned. - HARDWARE_ERROR = "HardwareError" #: The Device has hit hardware issues. - DEVICE_FORMATTED = "DeviceFormatted" #: Data copy failed. The Device was formatted by user. - DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" #: Data copy failed. Device metadata was modified by user. - STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" #: Data copy failed. Storage Account was not accessible during copy. - UNSUPPORTED_DATA = "UnsupportedData" #: Data copy failed. The Device data content is not supported. - -class DataAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the account. - """ - - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. - -class DoubleEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines secondary layer of software-based encryption enablement. - """ - - ENABLED = "Enabled" #: Software-based encryption is enabled. - DISABLED = "Disabled" #: Software-based encryption is disabled. - -class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the filter file. - """ - - AZURE_BLOB = "AzureBlob" #: Filter file is of the type AzureBlob. - AZURE_FILE = "AzureFile" #: Filter file is of the type AzureFiles. - -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Delivery type of Job. - """ - - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. - -class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of encryption key used for key encryption. - """ - - MICROSOFT_MANAGED = "MicrosoftManaged" #: Key encryption key is managed by Microsoft. - CUSTOMER_MANAGED = "CustomerManaged" #: Key encryption key is managed by the Customer. - -class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Level of the logs to be collected. - """ - - ERROR = "Error" #: Only Errors will be collected in the logs. - VERBOSE = "Verbose" #: Verbose logging (includes Errors, CRC, size information and others). - -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - - DEVICE_PREPARED = "DevicePrepared" #: Notification at device prepared stage. - DISPATCHED = "Dispatched" #: Notification at device dispatched stage. - DELIVERED = "Delivered" #: Notification at device delivered stage. - PICKED_UP = "PickedUp" #: Notification at device picked up from user stage. - AT_AZURE_DC = "AtAzureDC" #: Notification at device received at Azure datacenter stage. - DATA_COPY = "DataCopy" #: Notification at data copy started stage. - -class OverallValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Overall validation status. - """ - - ALL_VALID_TO_PROCEED = "AllValidToProceed" #: Every input request is valid. - INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" #: Some input requests are not valid. - CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" #: Certain input validations skipped. - -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the share. - """ - - UNKNOWN_TYPE = "UnknownType" #: Unknown format. - HCS = "HCS" #: Storsimple data format. - BLOCK_BLOB = "BlockBlob" #: Azure storage block blob format. - PAGE_BLOB = "PageBlob" #: Azure storage page blob format. - AZURE_FILE = "AzureFile" #: Azure storage file format. - MANAGED_DISK = "ManagedDisk" #: Azure Compute Disk. - AZURE_PREMIUM_FILES = "AzurePremiumFiles" #: Azure storage Premium Files format. - -class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the Sku is disabled. - """ - - NONE = "None" #: SKU is not disabled. - COUNTRY = "Country" #: SKU is not available in the requested country. - REGION = "Region" #: SKU is not available to push data to the requested Azure region. - FEATURE = "Feature" #: Required features are not enabled for the SKU. - OFFER_TYPE = "OfferType" #: Subscription does not have required offer types for the SKU. - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. - -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Data Box. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage which is in progress. - """ - - DEVICE_ORDERED = "DeviceOrdered" #: An order has been created. - DEVICE_PREPARED = "DevicePrepared" #: A device has been prepared for the order. - DISPATCHED = "Dispatched" #: Device has been dispatched to the user of the order. - DELIVERED = "Delivered" #: Device has been delivered to the user of the order. - PICKED_UP = "PickedUp" #: Device has been picked up from user and in transit to Azure datacenter. - AT_AZURE_DC = "AtAzureDC" #: Device has been received at Azure datacenter from the user. - DATA_COPY = "DataCopy" #: Data copy from the device at Azure datacenter. - COMPLETED = "Completed" #: Order has completed. - COMPLETED_WITH_ERRORS = "CompletedWithErrors" #: Order has completed with errors. - CANCELLED = "Cancelled" #: Order has been cancelled. - FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" #: Order has failed due to issue reported by user. - FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" #: Order has failed due to issue detected at Azure datacenter. - ABORTED = "Aborted" #: Order has been aborted. - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" #: Order has completed with warnings. - READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" #: Device is ready to be handed to customer from Azure DC. - READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" #: Device can be dropped off at Azure DC. - -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the job stage. - """ - - NONE = "None" #: No status available yet. - IN_PROGRESS = "InProgress" #: Stage is in progress. - SUCCEEDED = "Succeeded" #: Stage has succeeded. - FAILED = "Failed" #: Stage has failed. - CANCELLED = "Cancelled" #: Stage has been cancelled. - CANCELLING = "Cancelling" #: Stage is cancelling. - SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" #: Stage has succeeded with errors. - WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" #: Stage is stuck until customer takes some action. - SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" #: Stage has succeeded with warnings. - -class TransferConfigurationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the configuration for transfer. - """ - - TRANSFER_ALL = "TransferAll" #: Transfer all the data. - TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. - -class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the transfer. - """ - - IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. - EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. - -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Transport Shipment Type supported for given region. - """ - - CUSTOMER_MANAGED = "CustomerManaged" #: Shipment Logistics is handled by the customer. - MICROSOFT_MANAGED = "MicrosoftManaged" #: Shipment Logistics is handled by Microsoft. - -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Identifies the type of validation request. - """ - - VALIDATE_ADDRESS = "ValidateAddress" #: Identify request and response of address validation. - VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" #: Identify request and response for validation of subscription permission to create job. - VALIDATE_PREFERENCES = "ValidatePreferences" #: Identify request and response of preference validation. - VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" #: Identify request and response of create order limit for subscription validation. - VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" #: Identify request and response of active job limit for sku availability. - VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" #: Identify request and response of data transfer details validation. - -class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Create order limit validation status. - """ - - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. + +class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AccessProtocol.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines secondary layer of software-based encryption enablement.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py deleted file mode 100644 index 4da1571b91cc..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py +++ /dev/null @@ -1,3990 +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 azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_name: Name of the account. - :vartype account_name: str - :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_connection_string: Connection string of the account endpoint to use the account - as a storage endpoint on the device. - :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - 'account_name': {'readonly': True}, - 'data_account_type': {'readonly': True}, - 'account_connection_string': {'readonly': True}, - 'share_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, - 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.data_account_type = None - self.account_connection_string = None - self.share_credential_details = None - - -class AdditionalErrorInfo(msrest.serialization.Model): - """Additional error info. - - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(AdditionalErrorInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", - "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", - "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'CloudError'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - self.validation_status = None - self.alternate_addresses = None - - -class ValidationInputResponse(msrest.serialization.Model): - """Minimum properties that should be present in each individual validation response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputResponse, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - - -class AddressValidationProperties(ValidationInputResponse): - """The address validation output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'validation_status': {'key': 'validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.validation_status = None - self.alternate_addresses = None - - -class ApiError(msrest.serialization.Model): - """ApiError. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ApiError, self).__init__(**kwargs) - self.error = kwargs['error'] - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - All required parameters must be populated in order to send to Azure. - - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - - _validation = { - 'transfer_type': {'required': True}, - 'country': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'transfer_type': {'key': 'transferType', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class AzureFileFilterDetails(msrest.serialization.Model): - """Filter details to transfer Azure files. - - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] - """ - - _attribute_map = { - 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, - 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, - 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureFileFilterDetails, self).__init__(**kwargs) - self.file_prefix_list = kwargs.get('file_prefix_list', None) - self.file_path_list = kwargs.get('file_path_list', None) - self.file_share_list = kwargs.get('file_share_list', None) - - -class BlobFilterDetails(msrest.serialization.Model): - """Filter details to transfer Azure Blobs. - - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] - """ - - _attribute_map = { - 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, - 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, - 'container_list': {'key': 'containerList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(BlobFilterDetails, self).__init__(**kwargs) - self.blob_prefix_list = kwargs.get('blob_prefix_list', None) - self.blob_path_list = kwargs.get('blob_path_list', None) - self.container_list = kwargs.get('container_list', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class CloudError(msrest.serialization.Model): - """Cloud error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str - :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] - :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.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, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = None - self.additional_info = None - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _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, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - } - - _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} - } - - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.serialization.Model): - """Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar storage_account_name: Name of the storage account. This will be empty for data account - types other than storage account. - :vartype storage_account_name: str - :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", - "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_processed: To indicate bytes transferred. - :vartype bytes_processed: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed. - :vartype files_processed: long - :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming - conventions which were processed by automatic renaming. - :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long - :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: long - :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: long - :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. - Until this is true, the TotalBytesToProcess may not be valid. - :vartype is_enumeration_in_progress: bool - """ - - _validation = { - 'storage_account_name': {'readonly': True}, - '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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, - 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, - 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__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(msrest.serialization.Model): - """Minimum request requirement of any validation category. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations. - - All required parameters must be populated in order to send to Azure. - - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - 'validation_category': {'required': True}, - 'individual_request_details': {'required': True}, - } - - _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - } - - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) - self.validation_category = None # type: Optional[str] - self.individual_request_details = kwargs['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. - - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - """ - - _validation = { - 'validation_category': {'required': True}, - 'individual_request_details': {'required': True}, - } - - _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' # type: str - - -class ValidationInputRequest(msrest.serialization.Model): - """Minimum fields that must be present in any type of validation request. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.status = None - - -class DataAccountDetails(msrest.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. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - """ - - _validation = { - '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, - **kwargs - ): - super(DataAccountDetails, self).__init__(**kwargs) - self.data_account_type = None # type: Optional[str] - self.share_password = kwargs.get('share_password', None) - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when - LogCollectionLevel is set to Verbose. - :vartype copy_verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, - 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - 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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, - 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.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: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - _subtype_map = { - 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs.get('shipping_address', None) - self.delivery_package = None - self.return_package = None - self.data_import_details = kwargs.get('data_import_details', None) - self.data_export_details = kwargs.get('data_export_details', None) - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type 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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - _subtype_map = { - 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} - } - - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - self.dc_access_security_code = None - self.error = None - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, - 'pass_key': {'key': 'passKey', 'type': 'str'}, - 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -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. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the - LogCollectionLevel is set to verbose. - :vartype copy_verbose_log_link: list[str] - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, - 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - self.copy_verbose_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """Databox Heavy Device Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed - for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -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. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'cabinet_pod_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.serialization.Model): - """The secrets related to a databox heavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """Databox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype 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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for - TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password - itself. This will not be returned in Get Call. Password Requirements : Password must be - minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, - one number and one special character. Password cannot have the following characters : IilLoO0 - Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - '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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a databox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class ScheduleAvailabilityRequest(msrest.serialization.Model): - """Request body to get the availability for scheduling orders. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] - self.sku_name = None # type: Optional[str] - self.country = kwargs.get('country', 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. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' # type: str - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__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(msrest.serialization.Model): - """Details of the data to be used for exporting data from azure. - - All required parameters must be populated in order to send to Azure. - - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - - _validation = { - 'transfer_configuration': {'required': True}, - 'account_details': {'required': True}, - } - - _attribute_map = { - 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, - 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(DataExportDetails, self).__init__(**kwargs) - self.transfer_configuration = kwargs['transfer_configuration'] - self.log_collection_level = kwargs.get('log_collection_level', None) - self.account_details = kwargs['account_details'] - - -class DataImportDetails(msrest.serialization.Model): - """Details of the data to be used for importing data to azure. - - All required parameters must be populated in order to send to Azure. - - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails - """ - - _validation = { - 'account_details': {'required': True}, - } - - _attribute_map = { - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(DataImportDetails, self).__init__(**kwargs) - self.account_details = kwargs['account_details'] - - -class DataLocationToServiceLocationMap(msrest.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 - ): - super(DataLocationToServiceLocationMap, self).__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. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.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, - **kwargs - ): - super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str - self.data_export_details = kwargs.get('data_export_details', None) - self.data_import_details = kwargs.get('data_import_details', None) - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - - -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. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Data transfer details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str - self.status = None - - -class DcAccessSecurityCode(msrest.serialization.Model): - """Dc access security code. - - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str - """ - - _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - - -class Details(msrest.serialization.Model): - """Details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. - :type code: str - :param message: Required. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Details, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['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. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class EncryptionPreferences(msrest.serialization.Model): - """Preferences related to the Encryption. - - :param double_encryption: Defines secondary layer of software-based encryption enablement. - Possible values include: "Enabled", "Disabled". - :type double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption - """ - - _attribute_map = { - 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) - self.double_encryption = kwargs.get('double_encryption', None) - - -class ErrorDetail(msrest.serialization.Model): - """ErrorDetail. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type 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, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.target = kwargs.get('target', None) - - -class FilterFileDetails(msrest.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. - - :param filter_file_type: Required. Type of the filter file. Possible values include: - "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to - transfer. - :type filter_file_path: str - """ - - _validation = { - 'filter_file_type': {'required': True}, - 'filter_file_path': {'required': True}, - } - - _attribute_map = { - 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, - 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterFileDetails, self).__init__(**kwargs) - self.filter_file_type = kwargs['filter_file_type'] - self.filter_file_path = kwargs['filter_file_path'] - - -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type 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, - **kwargs - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' # type: str - - -class IdentityProperties(msrest.serialization.Model): - """Managed identity properties. - - :param type: Managed service identity type. - :type type: str - :param user_assigned: User assigned identity properties. - :type user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned': {'key': 'userAssigned', 'type': 'UserAssignedProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(IdentityProperties, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned = kwargs.get('user_assigned', None) - - -class JobDeliveryInfo(msrest.serialization.Model): - """Additional delivery info. - - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime - """ - - _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - self.identity = kwargs.get('identity', None) - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: - "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar is_cancellable: Describes whether the job is cancellable or not. - :vartype is_cancellable: bool - :ivar is_deletable: Describes whether the job is deletable or not. - :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. - :vartype is_shipping_address_editable: bool - :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. - :vartype is_prepare_to_ship_enabled: bool - :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :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, - **kwargs - ): - super(JobResource, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - self.transfer_type = kwargs['transfer_type'] - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.is_prepare_to_ship_enabled = None - self.status = None - self.start_time = None - self.error = None - self.details = kwargs.get('details', None) - self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.is_cancellable_without_fee = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.details = kwargs.get('details', None) - - -class JobStages(msrest.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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object - """ - - _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 - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - - -class KeyEncryptionKey(msrest.serialization.Model): - """Encryption key containing details about key to encrypt different keys. - - All required parameters must be populated in order to send to Azure. - - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param identity_properties: Managed identity properties used for key encryption. - :type identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed - KekType. - :type kek_vault_resource_id: str - """ - - _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, - **kwargs - ): - super(KeyEncryptionKey, self).__init__(**kwargs) - self.kek_type = kwargs['kek_type'] - self.identity_properties = kwargs.get('identity_properties', None) - self.kek_url = kwargs.get('kek_url', None) - self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) - - -class ManagedDiskDetails(DataAccountDetails): - """Details of the managed disks. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _validation = { - 'data_account_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedDiskDetails, self).__init__(**kwargs) - self.data_account_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type 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, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - """ - - _validation = { - '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, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - self.is_data_action = kwargs.get('is_data_action', None) - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type 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, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - self.encryption_preferences = kwargs.get('encryption_preferences', None) - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _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, - **kwargs - ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.status = None - - -class RegionConfigurationRequest(msrest.serialization.Model): - """Request body to get the configuration for the region. - - :param schedule_availability_request: Request body to get the availability for scheduling - orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given - sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest - """ - - _attribute_map = { - 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, - } - - def __init__( - self, - **kwargs - ): - super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) - - -class RegionConfigurationResponse(msrest.serialization.Model): - """Configuration response specific to a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar schedule_availability_response: Schedule availability for given sku in a region. - :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse - """ - - _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 - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - - -class ResourceIdentity(msrest.serialization.Model): - """Msi identity details of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param type: Identity type. - :type type: str - :ivar principal_id: Service Principal Id backing the Msi. - :vartype principal_id: str - :ivar tenant_id: Home Tenant Id. - :vartype tenant_id: str - :param user_assigned_identities: User Assigned Identities. - :type user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ScheduleAvailabilityResponse(msrest.serialization.Model): - """Schedule availability for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) - self.available_dates = None - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _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, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.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 - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs.get('postal_code', None) - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type 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, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", - "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type 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, - **kwargs - ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.status = None - - -class SkuCapacity(msrest.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 - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - self.multiplier = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar data_location_to_service_location_map: The map of data location to service location. - :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _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 - ): - super(SkuInformation, self).__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. - - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be - passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate - password itself. This will not be returned in Get Call. Password Requirements : Password must - be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase - alphabet, one number and one special character. Password cannot have the following characters : - IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str - """ - - _validation = { - 'data_account_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageAccountDetails, self).__init__(**kwargs) - self.data_account_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - - -class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): - """Properties of subscription permission to create job validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - self.status = None - - -class TransferAllDetails(msrest.serialization.Model): - """Details to transfer all data. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool - """ - - _validation = { - '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, - **kwargs - ): - super(TransferAllDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) - self.transfer_all_files = kwargs.get('transfer_all_files', None) - - -class TransferConfiguration(msrest.serialization.Model): - """Configuration for defining the transfer of data. - - All required parameters must be populated in order to send to Azure. - - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible - values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is - required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails - """ - - _validation = { - 'transfer_configuration_type': {'required': True}, - } - - _attribute_map = { - 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, - 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, - 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfiguration, self).__init__(**kwargs) - self.transfer_configuration_type = kwargs['transfer_configuration_type'] - self.transfer_filter_details = kwargs.get('transfer_filter_details', None) - self.transfer_all_details = kwargs.get('transfer_all_details', None) - - -class TransferConfigurationTransferAllDetails(msrest.serialization.Model): - """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails - """ - - _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferAllDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) - - -class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): - """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails - """ - - _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) - - -class TransferFilterDetails(msrest.serialization.Model): - """Details of the filtering the transfer of data. - - All required parameters must be populated in order to send to Azure. - - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] - """ - - _validation = { - 'data_account_type': {'required': True}, - } - - _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, - 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, - 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransferFilterDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.blob_filter_details = kwargs.get('blob_filter_details', None) - self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) - self.filter_file_details = kwargs.get('filter_file_details', None) - - -class TransportAvailabilityDetails(msrest.serialization.Model): - """Transport options availability details for given region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar shipment_type: Transport Shipment Type supported for given region. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'shipment_type': {'readonly': True}, - } - - _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None - - -class TransportAvailabilityRequest(msrest.serialization.Model): - """Request body to get the transport availability for given sku. - - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) - - -class TransportAvailabilityResponse(msrest.serialization.Model): - """Transport options available for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transport_availability_details: List of transport availability details for given region. - :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] - """ - - _validation = { - 'transport_availability_details': {'readonly': True}, - } - - _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) - self.transport_availability_details = None - - -class TransportPreferences(msrest.serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'preferred_shipment_type': {'required': True}, - } - - _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] - - -class UnencryptedCredentials(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.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, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.key_encryption_key = kwargs.get('key_encryption_key', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """Class defining User assigned identity details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedProperties(msrest.serialization.Model): - """User assigned identity properties. - - :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :type resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedProperties, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be shipped. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _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, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class ValidationResponse(msrest.serialization.Model): - """Response of pre job creation validations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain validationType and its - response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] - """ - - _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__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/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py index 133ebb9c5cd3..cdb5d509cace 100644 --- 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 @@ -1,4 +1,5 @@ # 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. @@ -7,163 +8,176 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +import sys +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from ... import _serialization -from ._data_box_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -class AccountCredentialDetails(msrest.serialization.Model): +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. Possible values include: "StorageAccount", + :ivar data_account_type: Type of the account. Known values are: "StorageAccount" and "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :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.models.ShareCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(AccountCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.account_name = None self.data_account_type = None self.account_connection_string = None self.share_credential_details = None -class AdditionalErrorInfo(msrest.serialization.Model): +class AdditionalErrorInfo(_serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :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[object] = None, - **kwargs - ): - super(AdditionalErrorInfo, self).__init__(**kwargs) + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, *, type: Optional[str] = None, info: Optional[JSON] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", - "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", - "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_11_01.models.ShippingAddress] """ _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, + "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]'}, + "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 - ): - super(AddressValidationOutput, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None self.validation_status = None self.alternate_addresses = None -class ValidationInputResponse(msrest.serialization.Model): +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. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, + DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, + SkuAvailabilityValidationResponseProperties, + SubscriptionIsAllowedToCreateJobValidationResponseProperties Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, + "validation_type": {"required": True}, + "error": {"readonly": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'CloudError'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, } _subtype_map = { - 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputResponse, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "AddressValidationProperties", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationResponseProperties", + "ValidateDataTransferDetails": "DataTransferDetailsValidationResponseProperties", + "ValidatePreferences": "PreferencesValidationResponseProperties", + "ValidateSkuAvailability": "SkuAvailabilityValidationResponseProperties", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationResponseProperties", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -175,72 +189,70 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype error: ~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.models.ShippingAddress] + :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}, + "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]'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "validation_status": {"key": "validationStatus", "type": "str"}, + "alternate_addresses": {"key": "alternateAddresses", "type": "[ShippingAddress]"}, } - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str self.validation_status = None self.alternate_addresses = None -class ApiError(msrest.serialization.Model): +class ApiError(_serialization.Model): """ApiError. All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.ErrorDetail """ _validation = { - 'error': {'required': True}, + "error": {"required": True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: "ErrorDetail", - **kwargs - ): - super(ApiError, self).__init__(**kwargs) + def __init__(self, *, error: "_models.ErrorDetail", **kwargs): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2020_11_01.models.ErrorDetail + """ + super().__init__(**kwargs) self.error = error -class ApplianceNetworkConfiguration(msrest.serialization.Model): +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. @@ -252,25 +264,23 @@ class ApplianceNetworkConfiguration(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, + "name": {"readonly": True}, + "mac_address": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "mac_address": {"key": "macAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.mac_address = None -class ArmBaseObject(msrest.serialization.Model): +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. @@ -284,120 +294,132 @@ class ArmBaseObject(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, + "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'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.id = None self.type = None -class AvailableSkuRequest(msrest.serialization.Model): +class AvailableSkuRequest(_serialization.Model): """The filters for showing the available skus. All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Type of the transfer. Required. Known values are: "ImportToAzure" and "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + 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}, + "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]'}, + "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, "TransferType"], + transfer_type: Union[str, "_models.TransferType"], country: str, location: str, - sku_names: Optional[List[Union[str, "SkuName"]]] = None, + sku_names: Optional[List[Union[str, "_models.SkuName"]]] = None, **kwargs ): - super(AvailableSkuRequest, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class AvailableSkusResult(_serialization.Model): """The available skus operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SkuInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class AzureFileFilterDetails(_serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :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]'}, + "file_prefix_list": {"key": "filePrefixList", "type": "[str]"}, + "file_path_list": {"key": "filePathList", "type": "[str]"}, + "file_share_list": {"key": "fileShareList", "type": "[str]"}, } def __init__( @@ -408,27 +430,35 @@ def __init__( file_share_list: Optional[List[str]] = None, **kwargs ): - super(AzureFileFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class BlobFilterDetails(_serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :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]'}, + "blob_prefix_list": {"key": "blobPrefixList", "type": "[str]"}, + "blob_path_list": {"key": "blobPathList", "type": "[str]"}, + "container_list": {"key": "containerList", "type": "[str]"}, } def __init__( @@ -439,78 +469,88 @@ def __init__( container_list: Optional[List[str]] = None, **kwargs ): - super(BlobFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class CancellationReason(_serialization.Model): """Reason for cancellation. All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs): + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason -class CloudError(msrest.serialization.Model): +class CloudError(_serialization.Model): """Cloud error. Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :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.models.CloudError] + :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.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2020_11_01.models.AdditionalErrorInfo] """ _validation = { - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "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]'}, + "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 + self, *, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, **kwargs ): - super(CloudError, self).__init__(**kwargs) + """ + :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 @@ -518,38 +558,39 @@ def __init__( self.additional_info = None -class ContactDetails(msrest.serialization.Model): +class ContactDetails(_serialization.Model): """Contact Details. All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :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}, + "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]'}, + "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__( @@ -560,10 +601,25 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - notification_preference: Optional[List["NotificationPreference"]] = None, + notification_preference: Optional[List["_models.NotificationPreference"]] = None, **kwargs ): - super(ContactDetails, self).__init__(**kwargs) + """ + :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 @@ -572,40 +628,43 @@ def __init__( self.notification_preference = notification_preference -class CopyLogDetails(msrest.serialization.Model): +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. + 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. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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}, + "copy_log_details_type": {"required": True}, } _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + "copy_log_details_type": {"key": "copyLogDetailsType", "type": "str"}, } _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} + "copy_log_details_type": { + "DataBox": "DataBoxAccountCopyLogDetails", + "DataBoxDisk": "DataBoxDiskCopyLogDetails", + "DataBoxHeavy": "DataBoxHeavyAccountCopyLogDetails", + } } - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] -class CopyProgress(msrest.serialization.Model): +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. @@ -613,83 +672,81 @@ class CopyProgress(msrest.serialization.Model): :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. Possible values include: "ImportToAzure", + :ivar transfer_type: Transfer type of data. Known values are: "ImportToAzure" and "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType - :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + :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.models.DataAccountType + :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: long + :vartype bytes_processed: int :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long + :vartype total_bytes_to_process: int :ivar files_processed: Number of files processed. - :vartype files_processed: long + :vartype files_processed: int :ivar total_files_to_process: Total files to process. - :vartype total_files_to_process: long + :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: long + :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: long + :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: long + :vartype renamed_container_count: int :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long + :vartype files_errored_out: int :ivar directories_errored_out: To indicate directories errored out in the job. - :vartype directories_errored_out: long + :vartype directories_errored_out: int :ivar invalid_directories_processed: To indicate directories renamed. - :vartype invalid_directories_processed: long + :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}, + "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': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, - 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, - 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__init__(**kwargs) + "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): + """ """ + super().__init__(**kwargs) self.storage_account_name = None self.transfer_type = None self.data_account_type = None @@ -707,43 +764,43 @@ def __init__( self.is_enumeration_in_progress = None -class ValidationRequest(msrest.serialization.Model): +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. + 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. - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :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}, + "validation_category": {"required": True}, + "individual_request_details": {"required": True}, } _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + "validation_category": {"key": "validationCategory", "type": "str"}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, } - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } + _subtype_map = {"validation_category": {"JobCreationValidation": "CreateJobValidations"}} - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = None # type: Optional[str] self.individual_request_details = individual_request_details @@ -753,66 +810,75 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :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}, + "validation_category": {"required": True}, + "individual_request_details": {"required": True}, } _attribute_map = { - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + "validation_category": {"key": "validationCategory", "type": "str"}, + "individual_request_details": {"key": "individualRequestDetails", "type": "[ValidationInputRequest]"}, } - def __init__( - self, - *, - individual_request_details: List["ValidationInputRequest"], - **kwargs - ): - super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) - self.validation_category = 'JobCreationValidation' # type: str + def __init__(self, *, individual_request_details: List["_models.ValidationInputRequest"], **kwargs): + """ + :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 = "JobCreationValidation" # type: str -class ValidationInputRequest(msrest.serialization.Model): +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. + 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. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "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 - ): - super(ValidationInputRequest, self).__init__(**kwargs) + "validation_type": { + "ValidateAddress": "ValidateAddress", + "ValidateCreateOrderLimit": "CreateOrderLimitForSubscriptionValidationRequest", + "ValidateDataTransferDetails": "DataTransferDetailsValidationRequest", + "ValidatePreferences": "PreferencesValidationRequest", + "ValidateSkuAvailability": "SkuAvailabilityValidationRequest", + "ValidateSubscriptionIsAllowedToCreateJob": "SubscriptionIsAllowedToCreateJobValidationRequest", + } + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -821,34 +887,34 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :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}, + "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, "SkuName"], - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + "validation_type": {"key": "validationType", "type": "str"}, + "device_type": {"key": "deviceType", "type": "str"}, + } + + def __init__(self, *, device_type: Union[str, "_models.SkuName"], **kwargs): + """ + :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 = "ValidateCreateOrderLimit" # type: str self.device_type = device_type @@ -859,79 +925,81 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str self.status = None -class DataAccountDetails(msrest.serialization.Model): +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. + 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. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { - 'data_account_type': {'required': True}, + "data_account_type": {"required": True}, } _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, + "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 - ): - super(DataAccountDetails, self).__init__(**kwargs) + "data_account_type": {"ManagedDisk": "ManagedDiskDetails", "StorageAccount": "StorageAccountDetails"} + } + + def __init__(self, *, share_password: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.share_password = share_password @@ -943,9 +1011,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -956,25 +1025,23 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str self.account_name = None self.copy_log_link = None self.copy_verbose_log_link = None @@ -987,9 +1054,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -999,31 +1067,29 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, + "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'}, + "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 - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str self.disk_serial_number = None self.error_log_link = None self.verbose_log_link = None -class DataBoxDiskCopyProgress(msrest.serialization.Model): +class DataBoxDiskCopyProgress(_serialization.Model): """DataBox Disk Copy Progress. Variables are only populated by the server, and will be ignored when sending a request. @@ -1031,127 +1097,147 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar serial_number: The serial number of the disk. :vartype serial_number: str :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long + :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. Possible values include: "NotStarted", "InProgress", + :ivar status: The Status of the copy. Known values are: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + "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}, + "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': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, + "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 - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.serial_number = None self.bytes_copied = None self.percent_complete = None self.status = None -class JobDetails(msrest.serialization.Model): +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. + 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + "job_stages": {"key": "jobStages", "type": "[JobStages]"}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "delivery_package": {"key": "deliveryPackage", "type": "PackageShippingDetails"}, + "return_package": {"key": "returnPackage", "type": "PackageShippingDetails"}, + "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'} + "job_details_type": { + "DataBox": "DataBoxJobDetails", + "DataBoxDisk": "DataBoxDiskJobDetails", + "DataBoxHeavy": "DataBoxHeavyJobDetails", + } } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(JobDetails, self).__init__(**kwargs) + """ + :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 @@ -1164,11 +1250,11 @@ def __init__( 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_terabytes = expected_data_size_in_terabytes + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes -class DataBoxDiskJobDetails(JobDetails): +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. @@ -1176,144 +1262,178 @@ class DataBoxDiskJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :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. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :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] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBoxDisk' # type: str + """ + :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 = "DataBoxDisk" # type: str self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None self.passkey = passkey -class JobSecrets(msrest.serialization.Model): +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. + 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. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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}, + "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'}, + "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'} + "job_secrets_type": { + "DataBox": "DataboxJobSecrets", + "DataBoxDisk": "DataBoxDiskJobSecrets", + "DataBoxHeavy": "DataBoxHeavyJobSecrets", + } } - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None self.error = None @@ -1326,15 +1446,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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.models.DiskSecret] + :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. @@ -1342,29 +1462,27 @@ class DataBoxDiskJobSecrets(JobSecrets): """ _validation = { - 'job_secrets_type': {'required': True}, - 'dc_access_security_code': {'readonly': True}, - 'error': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, + "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 - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str + "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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str self.disk_secrets = None self.pass_key = None self.is_passkey_user_defined = None @@ -1377,9 +1495,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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. @@ -1390,31 +1509,29 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - 'copy_verbose_log_link': {'readonly': True}, + "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]'}, + "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 - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str self.account_name = None self.copy_log_link = None self.copy_verbose_log_link = None -class DataBoxHeavyJobDetails(JobDetails): +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. @@ -1422,92 +1539,125 @@ class DataBoxHeavyJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :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 : @#-$%^!+=;:_()]+. - :type device_password: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str + """ + :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 = "DataBoxHeavy" # type: str self.copy_progress = None self.device_password = device_password @@ -1519,41 +1669,39 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError + :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.models.DataBoxHeavySecret] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str self.cabinet_pod_secrets = None -class DataBoxHeavySecret(msrest.serialization.Model): +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. @@ -1563,35 +1711,35 @@ class DataBoxHeavySecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1599,7 +1747,7 @@ def __init__( self.account_credential_details = None -class DataBoxJobDetails(JobDetails): +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. @@ -1607,92 +1755,125 @@ class DataBoxJobDetails(JobDetails): 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.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :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.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :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.models.CopyLogDetails] + :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.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :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. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :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 : @#-$%^!+=;:_()]+. - :type device_password: str + :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}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, + "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: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, - data_export_details: Optional[List["DataExportDetails"]] = None, - preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + 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 ): - super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) - self.job_details_type = 'DataBox' # type: str + """ + :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 = "DataBox" # type: str self.copy_progress = None self.device_password = device_password @@ -1704,82 +1885,89 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :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.models.DcAccessSecurityCode + :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.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :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}, + "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["DataBoxSecret"]] = None, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str + "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): + """ + :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 = "DataBox" # type: str self.pod_secrets = pod_secrets -class ScheduleAvailabilityRequest(msrest.serialization.Model): +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. + 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. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) + "sku_name": { + "DataBox": "DataBoxScheduleAvailabilityRequest", + "DataBoxDisk": "DiskScheduleAvailabilityRequest", + "DataBoxHeavy": "HeavyScheduleAvailabilityRequest", + } + } + + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = None # type: Optional[str] self.country = country @@ -1790,39 +1978,42 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBox' # type: str + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = "DataBox" # type: str -class DataBoxSecret(msrest.serialization.Model): +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. @@ -1832,35 +2023,35 @@ class DataBoxSecret(msrest.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.models.ApplianceNetworkConfiguration] + :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.models.AccountCredentialDetails] + :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}, + "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]'}, + "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 - ): - super(DataBoxSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.device_serial_number = None self.device_password = None self.network_configurations = None @@ -1868,73 +2059,82 @@ def __init__( self.account_credential_details = None -class DataExportDetails(msrest.serialization.Model): +class DataExportDetails(_serialization.Model): """Details of the data to be used for exporting data from azure. All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :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}, + "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'}, + "transfer_configuration": {"key": "transferConfiguration", "type": "TransferConfiguration"}, + "log_collection_level": {"key": "logCollectionLevel", "type": "str"}, + "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, } def __init__( self, *, - transfer_configuration: "TransferConfiguration", - account_details: "DataAccountDetails", - log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + transfer_configuration: "_models.TransferConfiguration", + account_details: "_models.DataAccountDetails", + log_collection_level: Union[str, "_models.LogCollectionLevel"] = "Error", **kwargs ): - super(DataExportDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :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}, + "account_details": {"required": True}, } _attribute_map = { - 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, + "account_details": {"key": "accountDetails", "type": "DataAccountDetails"}, } - def __init__( - self, - *, - account_details: "DataAccountDetails", - **kwargs - ): - super(DataImportDetails, self).__init__(**kwargs) + def __init__(self, *, account_details: "_models.DataAccountDetails", **kwargs): + """ + :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(msrest.serialization.Model): +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. @@ -1946,20 +2146,18 @@ class DataLocationToServiceLocationMap(msrest.serialization.Model): """ _validation = { - 'data_location': {'readonly': True}, - 'service_location': {'readonly': True}, + "data_location": {"readonly": True}, + "service_location": {"readonly": True}, } _attribute_map = { - 'data_location': {'key': 'dataLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + "data_location": {"key": "dataLocation", "type": "str"}, + "service_location": {"key": "serviceLocation", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.data_location = None self.service_location = None @@ -1969,48 +2167,61 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :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". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :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". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :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}, + "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'}, + "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, "SkuName"], - transfer_type: Union[str, "TransferType"], - data_export_details: Optional[List["DataExportDetails"]] = None, - data_import_details: Optional[List["DataImportDetails"]] = None, + 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 ): - super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str + """ + :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 = "ValidateDataTransferDetails" # type: str self.data_export_details = data_export_details self.data_import_details = data_import_details self.device_type = device_type @@ -2024,94 +2235,94 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Data transfer details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataTransferDetails' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str self.status = None -class DcAccessSecurityCode(msrest.serialization.Model): +class DcAccessSecurityCode(_serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :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'}, + "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 + self, *, reverse_dc_access_code: Optional[str] = None, forward_dc_access_code: Optional[str] = None, **kwargs ): - super(DcAccessSecurityCode, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Details(_serialization.Model): """Details. All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "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 - ): - super(Details, self).__init__(**kwargs) + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, code: str, message: str, **kwargs): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ + super().__init__(**kwargs) self.code = code self.message = message @@ -2121,46 +2332,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + 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_terabytes': {'required': True}, + "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_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + "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_terabytes: int, - country: Optional[str] = None, - **kwargs + self, *, storage_location: str, expected_data_size_in_tera_bytes: int, country: Optional[str] = None, **kwargs ): - super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes - - -class DiskSecret(msrest.serialization.Model): + """ + :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 = "DataBoxDisk" # type: str + 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. @@ -2173,71 +2391,69 @@ class DiskSecret(msrest.serialization.Model): """ _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, + "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'}, + "disk_serial_number": {"key": "diskSerialNumber", "type": "str"}, + "bit_locker_key": {"key": "bitLockerKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None -class EncryptionPreferences(msrest.serialization.Model): +class EncryptionPreferences(_serialization.Model): """Preferences related to the Encryption. - :param double_encryption: Defines secondary layer of software-based encryption enablement. - Possible values include: "Enabled", "Disabled". - :type double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption + :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'}, + "double_encryption": {"key": "doubleEncryption", "type": "str"}, } - def __init__( - self, - *, - double_encryption: Optional[Union[str, "DoubleEncryption"]] = None, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) + def __init__(self, *, double_encryption: Union[str, "_models.DoubleEncryption"] = "Disabled", **kwargs): + """ + :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(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """ErrorDetail. All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :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}, + "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'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[Details]"}, + "target": {"key": "target", "type": "str"}, } def __init__( @@ -2245,48 +2461,60 @@ def __init__( *, code: str, message: str, - details: Optional[List["Details"]] = None, + details: Optional[List["_models.Details"]] = None, target: Optional[str] = None, **kwargs ): - super(ErrorDetail, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param filter_file_type: Required. Type of the filter file. Possible values include: - "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to - transfer. - :type filter_file_path: str + :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}, + "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, "FilterFileType"], - filter_file_path: str, - **kwargs - ): - super(FilterFileDetails, self).__init__(**kwargs) + "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): + """ + :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 @@ -2296,160 +2524,180 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + 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}, + "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'}, + "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 - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) - self.sku_name = 'DataBoxHeavy' # type: str + def __init__(self, *, storage_location: str, country: Optional[str] = None, **kwargs): + """ + :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 = "DataBoxHeavy" # type: str -class IdentityProperties(msrest.serialization.Model): +class IdentityProperties(_serialization.Model): """Managed identity properties. - :param type: Managed service identity type. - :type type: str - :param user_assigned: User assigned identity properties. - :type user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties + :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'}, + "type": {"key": "type", "type": "str"}, + "user_assigned": {"key": "userAssigned", "type": "UserAssignedProperties"}, } def __init__( - self, - *, - type: Optional[str] = None, - user_assigned: Optional["UserAssignedProperties"] = None, - **kwargs + self, *, type: Optional[str] = None, user_assigned: Optional["_models.UserAssignedProperties"] = None, **kwargs ): - super(IdentityProperties, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class JobDeliveryInfo(_serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + "scheduled_date_time": {"key": "scheduledDateTime", "type": "iso-8601"}, } - def __init__( - self, - *, - scheduled_date_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) + def __init__(self, *, scheduled_date_time: Optional[datetime.datetime] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class Resource(_serialization.Model): """Model of the Resource. All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :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}, + "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'}, + "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: "Sku", + sku: "_models.Sku", tags: Optional[Dict[str, str]] = None, - identity: Optional["ResourceIdentity"] = None, + identity: Optional["_models.ResourceIdentity"] = None, **kwargs ): - super(Resource, self).__init__(**kwargs) + """ + :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): +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. - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :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 - :param transfer_type: Required. Type of the data transfer. Possible values include: - "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :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. @@ -2458,87 +2706,112 @@ class JobResource(Resource): :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. Possible values include: "DeviceOrdered", + :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". - :vartype status: str or ~azure.mgmt.databox.models.StageName + "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.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~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 - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar 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}, - '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}, + "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'}, - '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'}, + "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: "Sku", - transfer_type: Union[str, "TransferType"], + sku: "_models.Sku", + transfer_type: Union[str, "_models.TransferType"], tags: Optional[Dict[str, str]] = None, - identity: Optional["ResourceIdentity"] = None, - details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, - delivery_info: Optional["JobDeliveryInfo"] = 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 ): - super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) + """ + :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 @@ -2554,108 +2827,117 @@ def __init__( self.is_cancellable_without_fee = None -class JobResourceList(msrest.serialization.Model): +class JobResourceList(_serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["JobResource"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs ): - super(JobResourceList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class JobResourceUpdateParameter(_serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :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'}, + "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["ResourceIdentity"] = None, - details: Optional["UpdateJobDetails"] = None, + identity: Optional["_models.ResourceIdentity"] = None, + details: Optional["_models.UpdateJobDetails"] = None, **kwargs ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + :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". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + "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. Possible values include: "None", "InProgress", + :ivar stage_status: Status of the job stage. Known values are: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + "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: object + :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}, + "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'}, + "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 - ): - super(JobStages, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.stage_name = None self.display_name = None self.stage_status = None @@ -2663,44 +2945,56 @@ def __init__( self.job_stage_details = None -class KeyEncryptionKey(msrest.serialization.Model): +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. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param identity_properties: Managed identity properties used for key encryption. - :type identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :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. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { - 'kek_type': {'required': True}, + "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'}, + "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, "KekType"], - identity_properties: Optional["IdentityProperties"] = None, + 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 ): - super(KeyEncryptionKey, self).__init__(**kwargs) + """ + :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 @@ -2712,85 +3006,97 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :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}, + "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'}, + "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 + self, *, resource_group_id: str, staging_storage_account_id: str, share_password: Optional[str] = None, **kwargs ): - super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) - self.data_account_type = 'ManagedDisk' # type: str + """ + :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 = "ManagedDisk" # type: str self.resource_group_id = resource_group_id self.staging_storage_account_id = staging_storage_account_id -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_serialization.Model): """Notification preference for a job stage. All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :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}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool = True, **kwargs ): - super(NotificationPreference, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class Operation(_serialization.Model): """Operation entity. Variables are only populated by the server, and will be ignored when sending a request. @@ -2799,37 +3105,36 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2020_11_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: JSON :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :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}, + "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 - ): - super(Operation, self).__init__(**kwargs) + "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): + """ + :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 @@ -2837,24 +3142,24 @@ def __init__( self.is_data_action = is_data_action -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :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'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -2866,45 +3171,54 @@ def __init__( description: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class OperationList(_serialization.Model): """Operation Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :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}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class PackageShippingDetails(_serialization.Model): """Shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2918,53 +3232,59 @@ class PackageShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "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'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.carrier_name = None self.tracking_id = None self.tracking_url = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences + :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'}, + "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["TransportPreferences"] = None, - encryption_preferences: Optional["EncryptionPreferences"] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, + encryption_preferences: Optional["_models.EncryptionPreferences"] = None, **kwargs ): - super(Preferences, self).__init__(**kwargs) + """ + :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 @@ -2975,38 +3295,45 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "preference": {"key": "preference", "type": "Preferences"}, + "device_type": {"key": "deviceType", "type": "str"}, } def __init__( self, *, - device_type: Union[str, "SkuName"], - preference: Optional["Preferences"] = None, + device_type: Union[str, "_models.SkuName"], + preference: Optional["_models.Preferences"] = None, **kwargs ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + """ + :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 = "ValidatePreferences" # type: str self.preference = preference self.device_type = device_type @@ -3018,141 +3345,166 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str self.status = None -class RegionConfigurationRequest(msrest.serialization.Model): +class RegionConfigurationRequest(_serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :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. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :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'}, + "schedule_availability_request": {"key": "scheduleAvailabilityRequest", "type": "ScheduleAvailabilityRequest"}, + "transport_availability_request": { + "key": "transportAvailabilityRequest", + "type": "TransportAvailabilityRequest", + }, } def __init__( self, *, - schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, - transport_availability_request: Optional["TransportAvailabilityRequest"] = None, + schedule_availability_request: Optional["_models.ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["_models.TransportAvailabilityRequest"] = None, **kwargs ): - super(RegionConfigurationRequest, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class RegionConfigurationResponse(_serialization.Model): """Configuration response specific to a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~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.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityResponse """ _validation = { - 'schedule_availability_response': {'readonly': True}, - 'transport_availability_response': {'readonly': True}, + "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 - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) + "schedule_availability_response": { + "key": "scheduleAvailabilityResponse", + "type": "ScheduleAvailabilityResponse", + }, + "transport_availability_response": { + "key": "transportAvailabilityResponse", + "type": "TransportAvailabilityResponse", + }, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None -class ResourceIdentity(msrest.serialization.Model): +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. - :param type: Identity type. - :type type: str + :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 - :param user_assigned_identities: User Assigned Identities. - :type user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] + :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}, + "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}'}, + "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: Optional[str] = None, - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + type: str = "None", + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, **kwargs ): - super(ResourceIdentity, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. @@ -3162,60 +3514,57 @@ class ScheduleAvailabilityResponse(msrest.serialization.Model): """ _validation = { - 'available_dates': {'readonly': True}, + "available_dates": {"readonly": True}, } _attribute_map = { - 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, + "available_dates": {"key": "availableDates", "type": "[iso-8601]"}, } - def __init__( - self, - **kwargs - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.available_dates = None -class ShareCredentialDetails(msrest.serialization.Model): +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. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :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.models.AccessProtocol] + :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}, + "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]'}, + "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 - ): - super(ShareCredentialDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.share_name = None self.share_type = None self.user_name = None @@ -3223,48 +3572,51 @@ def __init__( self.supported_access_protocols = None -class ShipmentPickUpRequest(msrest.serialization.Model): +class ShipmentPickUpRequest(_serialization.Model): """Shipment pick up request details. All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :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}, + "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 - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) + "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): + """ + :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(msrest.serialization.Model): +class ShipmentPickUpResponse(_serialization.Model): """Shipment pick up response. Variables are only populated by the server, and will be ignored when sending a request. @@ -3277,68 +3629,65 @@ class ShipmentPickUpResponse(msrest.serialization.Model): """ _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, + "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'}, + "confirmation_number": {"key": "confirmationNumber", "type": "str"}, + "ready_by_time": {"key": "readyByTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None -class ShippingAddress(msrest.serialization.Model): +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. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :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}, + "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'}, + "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__( @@ -3353,10 +3702,33 @@ def __init__( postal_code: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Union[str, "_models.AddressType"] = "None", **kwargs ): - super(ShippingAddress, self).__init__(**kwargs) + """ + :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 @@ -3369,39 +3741,48 @@ def __init__( self.address_type = address_type -class Sku(msrest.serialization.Model): +class Sku(_serialization.Model): """The Sku. All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: The sku name. Required. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :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}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "family": {"key": "family", "type": "str"}, } def __init__( self, *, - name: Union[str, "SkuName"], + name: Union[str, "_models.SkuName"], display_name: Optional[str] = None, family: Optional[str] = None, **kwargs ): - super(Sku, self).__init__(**kwargs) + """ + :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 @@ -3412,52 +3793,68 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :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". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :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. - :type location: str + Required. + :vartype location: str """ _validation = { - 'validation_type': {'required': True}, - 'device_type': {'required': True}, - 'transfer_type': {'required': True}, - 'country': {'required': True}, - 'location': {'required': True}, + "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'}, + "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, "SkuName"], - transfer_type: Union[str, "TransferType"], + device_type: Union[str, "_models.SkuName"], + transfer_type: Union[str, "_models.TransferType"], country: str, location: str, **kwargs ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + """ + :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 = "ValidateSkuAvailability" # type: str self.device_type = device_type self.transfer_type = transfer_type self.country = country @@ -3471,40 +3868,38 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + :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.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str self.status = None -class SkuCapacity(msrest.serialization.Model): +class SkuCapacity(_serialization.Model): """Capacity of the sku. Variables are only populated by the server, and will be ignored when sending a request. @@ -3516,25 +3911,23 @@ class SkuCapacity(msrest.serialization.Model): """ _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, + "usable": {"readonly": True}, + "maximum": {"readonly": True}, } _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, + "usable": {"key": "usable", "type": "str"}, + "maximum": {"key": "maximum", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.usable = None self.maximum = None -class SkuCost(msrest.serialization.Model): +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. @@ -3550,48 +3943,46 @@ class SkuCost(msrest.serialization.Model): """ _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, - 'multiplier': {'readonly': True}, + "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'}, + "meter_id": {"key": "meterId", "type": "str"}, + "meter_type": {"key": "meterType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, } - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.meter_id = None self.meter_type = None self.multiplier = None -class SkuInformation(msrest.serialization.Model): +class SkuInformation(_serialization.Model): """Information of the sku. Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :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.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2020_11_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2020_11_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :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. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :ivar disabled_reason: Reason why the Sku is disabled. 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. @@ -3599,34 +3990,35 @@ class SkuInformation(msrest.serialization.Model): """ _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}, + "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 - ): - super(SkuInformation, self).__init__(**kwargs) + "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): + """ """ + super().__init__(**kwargs) self.sku = None self.enabled = None self.data_location_to_service_location_map = None @@ -3643,40 +4035,45 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :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 : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :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}, + "data_account_type": {"required": True}, + "storage_account_id": {"required": True}, } _attribute_map = { - 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - *, - storage_account_id: str, - share_password: Optional[str] = None, - **kwargs - ): - super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) - self.data_account_type = 'StorageAccount' # type: str + "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): + """ + :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 = "StorageAccount" # type: str self.storage_account_id = storage_account_id @@ -3685,27 +4082,25 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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}, + "validation_type": {"required": True}, } _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, + "validation_type": {"key": "validationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): @@ -3715,306 +4110,394 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :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.models.CloudError - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype error: ~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}, + "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'}, + "validation_type": {"key": "validationType", "type": "str"}, + "error": {"key": "error", "type": "CloudError"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str self.status = None -class TransferAllDetails(msrest.serialization.Model): +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): + """ """ + 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. - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :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}, + "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'}, + "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, "DataAccountType"], + data_account_type: Union[str, "_models.DataAccountType"], transfer_all_blobs: Optional[bool] = None, transfer_all_files: Optional[bool] = None, **kwargs ): - super(TransferAllDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class TransferConfiguration(_serialization.Model): """Configuration for defining the transfer of data. All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible - values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :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. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :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}, + "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'}, + "transfer_configuration_type": {"key": "transferConfigurationType", "type": "str"}, + "transfer_filter_details": { + "key": "transferFilterDetails", + "type": "TransferConfigurationTransferFilterDetails", + }, + "transfer_all_details": {"key": "transferAllDetails", "type": "TransferConfigurationTransferAllDetails"}, } def __init__( self, *, - transfer_configuration_type: Union[str, "TransferConfigurationType"], - transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, - transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, + transfer_configuration_type: Union[str, "_models.TransferConfigurationType"], + transfer_filter_details: Optional["_models.TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["_models.TransferConfigurationTransferAllDetails"] = None, **kwargs ): - super(TransferConfiguration, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2020_11_01.models.TransferAllDetails """ _attribute_map = { - 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + "include": {"key": "include", "type": "TransferAllDetails"}, } - def __init__( - self, - *, - include: Optional["TransferAllDetails"] = None, - **kwargs - ): - super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + def __init__(self, *, include: Optional["_models.TransferAllDetails"] = None, **kwargs): + """ + :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(msrest.serialization.Model): +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. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :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'}, + "include": {"key": "include", "type": "TransferFilterDetails"}, } - def __init__( - self, - *, - include: Optional["TransferFilterDetails"] = None, - **kwargs - ): - super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + def __init__(self, *, include: Optional["_models.TransferFilterDetails"] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class TransferFilterDetails(_serialization.Model): """Details of the filtering the transfer of data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: - "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :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}, + "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]'}, + "data_account_type": {"key": "dataAccountType", "type": "str"}, + "blob_filter_details": {"key": "blobFilterDetails", "type": "BlobFilterDetails"}, + "azure_file_filter_details": {"key": "azureFileFilterDetails", "type": "AzureFileFilterDetails"}, + "filter_file_details": {"key": "filterFileDetails", "type": "[FilterFileDetails]"}, } def __init__( self, *, - data_account_type: Union[str, "DataAccountType"], - blob_filter_details: Optional["BlobFilterDetails"] = None, - azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, - filter_file_details: Optional[List["FilterFileDetails"]] = None, + 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 ): - super(TransferFilterDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "shipment_type": {"readonly": True}, } _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + "shipment_type": {"key": "shipmentType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.shipment_type = None -class TransportAvailabilityRequest(msrest.serialization.Model): +class TransportAvailabilityRequest(_serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Known values are: "DataBox", "DataBoxDisk", and "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName """ _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, + "sku_name": {"key": "skuName", "type": "str"}, } - def __init__( - self, - *, - sku_name: Optional[Union[str, "SkuName"]] = None, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) + def __init__(self, *, sku_name: Optional[Union[str, "_models.SkuName"]] = None, **kwargs): + """ + :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(msrest.serialization.Model): +class TransportAvailabilityResponse(_serialization.Model): """Transport options available for given sku in a region. Variables are only populated by the server, and will be ignored when sending a request. :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityDetails] """ _validation = { - 'transport_availability_details': {'readonly': True}, + "transport_availability_details": {"readonly": True}, } _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, + "transport_availability_details": { + "key": "transportAvailabilityDetails", + "type": "[TransportAvailabilityDetails]", + }, } - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.transport_availability_details = None -class TransportPreferences(msrest.serialization.Model): +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. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :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}, + "preferred_shipment_type": {"required": True}, } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, } - def __init__( - self, - *, - preferred_shipment_type: Union[str, "TransportShipmentTypes"], - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs): + """ + :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(msrest.serialization.Model): +class UnencryptedCredentials(_serialization.Model): """Unencrypted credentials for accessing device. Variables are only populated by the server, and will be ignored when sending a request. @@ -4022,86 +4505,98 @@ class UnencryptedCredentials(msrest.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.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2020_11_01.models.JobSecrets """ _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, + "job_name": {"readonly": True}, + "job_secrets": {"readonly": True}, } _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, + "job_name": {"key": "jobName", "type": "str"}, + "job_secrets": {"key": "jobSecrets", "type": "JobSecrets"}, } - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.job_name = None self.job_secrets = None -class UnencryptedCredentialsList(msrest.serialization.Model): +class UnencryptedCredentialsList(_serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :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'}, + "value": {"key": "value", "type": "[UnencryptedCredentials]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["UnencryptedCredentials"]] = None, + value: Optional[List["_models.UnencryptedCredentials"]] = None, next_link: Optional[str] = None, **kwargs ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +class UpdateJobDetails(_serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :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'}, + "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["ContactDetails"] = None, - shipping_address: Optional["ShippingAddress"] = None, - key_encryption_key: Optional["KeyEncryptionKey"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + key_encryption_key: Optional["_models.KeyEncryptionKey"] = None, **kwargs ): - super(UpdateJobDetails, self).__init__(**kwargs) + """ + :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(msrest.serialization.Model): +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. @@ -4113,42 +4608,39 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.principal_id = None self.client_id = None -class UserAssignedProperties(msrest.serialization.Model): +class UserAssignedProperties(_serialization.Model): """User assigned identity properties. - :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :type resource_id: str + :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'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - super(UserAssignedProperties, self).__init__(**kwargs) + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): + """ + :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 @@ -4157,75 +4649,86 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :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}, + "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'}, + "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: "ShippingAddress", - device_type: Union[str, "SkuName"], - transport_preferences: Optional["TransportPreferences"] = None, + shipping_address: "_models.ShippingAddress", + device_type: Union[str, "_models.SkuName"], + transport_preferences: Optional["_models.TransportPreferences"] = None, **kwargs ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str + """ + :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 = "ValidateAddress" # type: str self.shipping_address = shipping_address self.device_type = device_type self.transport_preferences = transport_preferences -class ValidationResponse(msrest.serialization.Model): +class ValidationResponse(_serialization.Model): """Response of pre job creation validations. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :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.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputResponse] """ _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, + "status": {"readonly": True}, + "individual_response_details": {"readonly": True}, } _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, + "status": {"key": "properties.status", "type": "str"}, + "individual_response_details": { + "key": "properties.individualResponseDetails", + "type": "[ValidationInputResponse]", + }, } - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 9c8fa7a82538..b257f8450257 100644 --- 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 @@ -10,8 +10,14 @@ from ._jobs_operations import JobsOperations from ._service_operations import ServiceOperations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'JobsOperations', - 'ServiceOperations', + "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 index 5f8d902f7a40..b2d3dfab13f0 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,99 +6,395 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + accept = _headers.pop("Accept", "application/json") -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + # 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 = _format_url_section(_url, **path_format_arguments) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -class JobsOperations(object): - """JobsOperations operations. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. +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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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") - def list( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + @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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,76 +403,80 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def list_by_resource_group( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + 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. + :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. + 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 JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -184,658 +485,997 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"} # type: ignore + @distributed_trace def get( - self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. + 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.models.JobResource - :raises: ~azure.core.exceptions.HttpResponseError + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _create_initial( - self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._create_initial( + raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - def _delete_initial( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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}'} # type: ignore + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore - def begin_delete( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + @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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + 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 - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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 = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :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. + 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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.models.JobResource] + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: - raw_result = self._update_initial( + raw_result = self._update_initial( # type: ignore resource_group_name=resource_group_name, job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('JobResource', pipeline_response) - + deserialized = self._deserialize("JobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @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, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :param shipment_pick_up_request: Details of shipment pick up request. Is either a model 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.models.ShipmentPickUpResponse - :raises: ~azure.core.exceptions.HttpResponseError + :return: ShipmentPickUpResponse or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpResponse + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore - def cancel( + book_shipment_pick_up.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"} # type: ignore + + @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, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource group. 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. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a model 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) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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'} # type: ignore + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"} # type: ignore + @distributed_trace def list_credentials( - self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str :param job_name: The name of the job Resource within the specified resource 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 UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -844,17 +1484,18 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py index 42d935a9c74e..0c45c00b85ce 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/v2020_11_01/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,87 +6,122 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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 + -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + accept = _headers.pop("Accept", "application/json") -class Operations(object): - """Operations operations. + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + # 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_11_01.DataBoxManagementClient`'s + :attr:`operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + 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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :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] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = self._client.get(url, query_parameters, header_parameters) + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationList', pipeline_response) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,17 +130,18 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list.metadata = {"url": "/providers/Microsoft.DataBox/operations"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 index 0d52bed1577f..8a37318f5d71 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,111 +6,385 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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 HttpRequest, HttpResponse +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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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) -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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 {}) -class ServiceOperations(object): - """ServiceOperations operations. + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + # 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"), + } - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + 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, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :param available_sku_request: Filters for showing the available skus. Is either a model 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 AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] - :raises: ~azure.core.exceptions.HttpResponseError + :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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = "application/json" - accept = "application/json" + 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): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + 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) # type: ignore + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AvailableSkusResult', pipeline_response) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,349 +393,666 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + 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'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_available_skus_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"} # type: ignore + @overload def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + 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. + :param location: The location of the resource. Required. :type location: str - :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :param validate_address: Shipping address of the customer. Is either a model 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.models.AddressValidationOutput - :raises: ~azure.core.exceptions.HttpResponseError + :return: AddressValidationOutput or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + validate_address.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"} # type: ignore + + @overload def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) 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'} # type: ignore + validate_inputs_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + 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. + :param location: The location of the resource. Required. :type location: str - :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :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.models.ValidationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + validate_inputs.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"} # type: ignore + + @overload def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + 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. + :param location: The location of the resource. Required. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + region_configuration.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore + + @overload def region_configuration_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + 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. + :param resource_group_name: The Resource Group Name. Required. :type resource_group_name: str - :param location: The location of the resource. + :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. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + 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.models.RegionConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError + :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 model 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: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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 = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + 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) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + region_configuration_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"} # type: ignore 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 new file mode 100644 index 000000000000..c3f328be41df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..6b2218f96149 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 = kwargs.pop("api_version", "2021-03-01") # type: str + + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = 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 new file mode 100644 index 000000000000..dd9317dc7db2 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..4a2a1e11cd9a --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json @@ -0,0 +1,123 @@ +{ + "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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", + "docstring_type": "str", + "required": true + } + }, + "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=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}", + "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 model type or a IO 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 model type or a IO 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" + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..762aed0f11ce --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 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: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class MixinABC(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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" 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 new file mode 100644 index 000000000000..e9ac07d95558 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..7dcfb1580122 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, 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 = kwargs.pop("api_version", "2021-03-01") # type: str + + 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 new file mode 100644 index 000000000000..cec53a4f7ce8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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) -> 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py new file mode 100644 index 000000000000..8c62b2b70648 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 MixinABC(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_03_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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_03_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..c1c066584b80 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,172 @@ +# 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 MixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DataBoxManagementClientOperationsMixin(MixinABC): + @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_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 + 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..5503eb2bc9b6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py @@ -0,0 +1,1227 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..68db0bbb1c3b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6804c88be493 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py @@ -0,0 +1,872 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..98598bd436c9 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py @@ -0,0 +1,275 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..e3323f047d67 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + + +class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """CustomerResolutionCode.""" + + #: No Resolution Yet + NONE = "None" + #: Clean the device + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage + RESUME = "Resume" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines secondary layer of software-based encryption enablement.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "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 new file mode 100644 index 000000000000..a0eac151f5f7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py @@ -0,0 +1,4847 @@ +# 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 TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +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): + """ """ + 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): + """ + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str + 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): + """ + :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): + """ """ + 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): + """ """ + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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): + """ """ + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "JobCreationValidation" # type: str + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +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): + """ + :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 = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str + 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): + """ + :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 = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +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): + """ """ + 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 + ): + """ + :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 = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None + + +class DataBoxDiskJobSecrets(JobSecrets): + """The secrets related to disk job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str + 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 + ): + """ + :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 = "DataBoxHeavy" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str + 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): + """ """ + 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 + ): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "DataBox" # type: str + + +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): + """ """ + 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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 = "ValidateDataTransferDetails" # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + 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): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 = "DataBoxHeavy" # type: str + + +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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ManagedDisk" # type: str + 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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 = "ValidatePreferences" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str + 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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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): + """ """ + 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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ValidateSkuAvailability" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str + 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): + """ """ + 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): + """ """ + 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): + """ """ + 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): + """ + :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 = "StorageAccount" # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + 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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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 + ): + """ + :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 = "ValidateAddress" # type: str + 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): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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_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 new file mode 100644 index 000000000000..789f8c596b46 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,206 @@ +# 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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..7d99a9dfdfb0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py @@ -0,0 +1,1501 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..0d4b5f4186c7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py @@ -0,0 +1,147 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..3f486c208ebc --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py @@ -0,0 +1,1058 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed @@ -0,0 +1 @@ +# 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 new file mode 100644 index 000000000000..c3f328be41df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..38f0aa0485be --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 = kwargs.pop("api_version", "2021-05-01") # type: str + + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = 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 new file mode 100644 index 000000000000..9d2a6f60ee77 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..182f925c1878 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json @@ -0,0 +1,123 @@ +{ + "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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", + "docstring_type": "str", + "required": true + } + }, + "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=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}", + "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 model type or a IO 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 model type or a IO 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" + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..762aed0f11ce --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 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: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class MixinABC(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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" 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 new file mode 100644 index 000000000000..e9ac07d95558 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..7cdfb42ea87d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, 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 = kwargs.pop("api_version", "2021-05-01") # type: str + + 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 new file mode 100644 index 000000000000..cc79922d09d8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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) -> 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..8c62b2b70648 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 MixinABC(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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..dce13741ce3b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,172 @@ +# 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 MixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DataBoxManagementClientOperationsMixin(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..4fef06b328da --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py @@ -0,0 +1,1227 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e44fe24eaae6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..cf2b254a98e7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py @@ -0,0 +1,872 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..98598bd436c9 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py @@ -0,0 +1,275 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..6a43869d0adc --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py @@ -0,0 +1,339 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + + +class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """CustomerResolutionCode.""" + + #: No Resolution Yet + NONE = "None" + #: Clean the device + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage + RESUME = "Resume" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DoubleEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines secondary layer of software-based encryption enablement.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "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 new file mode 100644 index 000000000000..63f03c3c31df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py @@ -0,0 +1,4848 @@ +# 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 TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +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): + """ """ + 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): + """ + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str + 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): + """ + :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): + """ """ + 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): + """ """ + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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): + """ """ + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "JobCreationValidation" # type: str + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +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): + """ + :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 = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str + 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): + """ + :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 = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +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): + """ """ + 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 + ): + """ + :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 = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None + + +class DataBoxDiskJobSecrets(JobSecrets): + """The secrets related to disk job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str + 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 + ): + """ + :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 = "DataBoxHeavy" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str + 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): + """ """ + 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 + ): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "DataBox" # type: str + + +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): + """ """ + 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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 = "ValidateDataTransferDetails" # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + 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): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 = "DataBoxHeavy" # type: str + + +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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ManagedDisk" # type: str + 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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 = "ValidatePreferences" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str + 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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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): + """ """ + 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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ValidateSkuAvailability" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str + 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): + """ """ + 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): + """ """ + 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): + """ """ + 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): + """ + :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 = "StorageAccount" # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + 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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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 + ): + """ + :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 = "ValidateAddress" # type: str + 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): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..863074e9f8ba --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,206 @@ +# 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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..368efd164940 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py @@ -0,0 +1,1501 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..0792ecac5076 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py @@ -0,0 +1,147 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..9ffe67589e18 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py @@ -0,0 +1,1058 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed @@ -0,0 +1 @@ +# 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 new file mode 100644 index 000000000000..c3f328be41df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..ccc183619fb4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 = kwargs.pop("api_version", "2021-08-01-preview") # type: str + + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = 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 new file mode 100644 index 000000000000..18277ebd78fa --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..6c2c4e3423b5 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json @@ -0,0 +1,123 @@ +{ + "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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", + "docstring_type": "str", + "required": true + } + }, + "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=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}", + "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 model type or a IO 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 model type or a IO 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" + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..762aed0f11ce --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 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: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class MixinABC(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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" 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 new file mode 100644 index 000000000000..e9ac07d95558 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..ee1866e874bc --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, 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 = kwargs.pop("api_version", "2021-08-01-preview") # type: str + + 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 new file mode 100644 index 000000000000..0c186e295393 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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) -> 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py new file mode 100644 index 000000000000..8c62b2b70648 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 MixinABC(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_08_01_preview/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..88bc7f5cad4b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,173 @@ +# 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 MixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DataBoxManagementClientOperationsMixin(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..693f2c505e4d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py @@ -0,0 +1,1377 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..34d5d4210004 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6e45b7b5e572 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py @@ -0,0 +1,875 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5564db7b127 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py @@ -0,0 +1,305 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..3764c4b744c6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk orders. + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + #: No copy triggered as device was not received. + DRIVE_NOT_RECEIVED = "DriveNotReceived" + #: No copy triggered as device type is not supported. + UNSUPPORTED_DRIVE = "UnsupportedDrive" + #: Copy failed due to service error. + OTHER_SERVICE_ERROR = "OtherServiceError" + #: Copy failed due to user error. + OTHER_USER_ERROR = "OtherUserError" + #: Copy failed due to disk detection error. + DRIVE_NOT_DETECTED = "DriveNotDetected" + #: Copy failed due to corrupted drive. + DRIVE_CORRUPTED = "DriveCorrupted" + #: Copy failed due to modified or removed metadata files. + METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" + + +class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """CustomerResolutionCode.""" + + #: No Resolution Yet + NONE = "None" + #: Clean the device + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage + RESUME = "Resume" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Data center address type.""" + + #: Data center address location. + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + #: Data center address instruction. + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + + +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.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + #: Notification at job created stage. + CREATED = "Created" + #: Notification at shipped devices to customer stage. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + #: Job created by the customer. + CREATED = "Created" + #: User shipped the device to AzureDC. + SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" + #: Awaiting shipment details of device from customer. + AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" + #: Preparing the device to ship to customer. + PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" + #: Shipped the device to customer. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "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 new file mode 100644 index 000000000000..d3d2040b3227 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py @@ -0,0 +1,5818 @@ +# 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 TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +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): + """ """ + 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): + """ + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str + 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): + """ + :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): + """ """ + 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): + """ """ + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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): + """ """ + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "JobCreationValidation" # type: str + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +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): + """ + :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 = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxCustomerDisk" # type: str + 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): + """ + :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 = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxCustomerDisk" # type: str + 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): + """ """ + 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 + ): + """ + :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 = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.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 + ): + """ + :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 = "DataBoxCustomerDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +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): + """ """ + 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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str + 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 + ): + """ + :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 = "DataBoxHeavy" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str + 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): + """ """ + 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 + ): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "DataBox" # type: str + + +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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressInstruction" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressLocation" # type: str + 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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 = "ValidateDataTransferDetails" # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + 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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ + :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 = "DataBoxHeavy" # type: str + + +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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ManagedDisk" # type: str + 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): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 = "ValidatePreferences" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str + 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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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): + """ """ + 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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ValidateSkuAvailability" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str + 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): + """ """ + 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): + """ """ + 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): + """ """ + 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): + """ + :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 = "StorageAccount" # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + 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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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 + ): + """ + :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 = "ValidateAddress" # type: str + 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): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..ea2c99a9b5f4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py @@ -0,0 +1,207 @@ +# 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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f134da40fdca --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py @@ -0,0 +1,1686 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..5703a5ff8c8b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py @@ -0,0 +1,147 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..4f29dc5f1d56 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py @@ -0,0 +1,1064 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed @@ -0,0 +1 @@ +# 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 new file mode 100644 index 000000000000..c3f328be41df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..2cdbb67e2b18 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 = kwargs.pop("api_version", "2021-12-01") # type: str + + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = 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 new file mode 100644 index 000000000000..0c167f382d4b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_data_box_management_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..44052ebb89e7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_metadata.json @@ -0,0 +1,123 @@ +{ + "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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", + "docstring_type": "str", + "required": true + } + }, + "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=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}", + "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 model type or a IO 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 model type or a IO 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" + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..762aed0f11ce --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_vendor.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 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: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class MixinABC(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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" 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 new file mode 100644 index 000000000000..e9ac07d95558 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..56c9a6ffbb30 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, 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 = kwargs.pop("api_version", "2021-12-01") # type: str + + 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 new file mode 100644 index 000000000000..fb0251a63c61 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_data_box_management_client.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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) -> 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..8c62b2b70648 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 MixinABC(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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..9f6e649f7602 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,172 @@ +# 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 MixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DataBoxManagementClientOperationsMixin(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..90413ab645af --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_jobs_operations.py @@ -0,0 +1,1369 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f26624f357c6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..55d66259fce7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/aio/operations/_service_operations.py @@ -0,0 +1,872 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..49bd239b4b1f --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/__init__.py @@ -0,0 +1,313 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..2595ea068643 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_data_box_management_client_enums.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk orders. + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + #: No copy triggered as device was not received. + DRIVE_NOT_RECEIVED = "DriveNotReceived" + #: No copy triggered as device type is not supported. + UNSUPPORTED_DRIVE = "UnsupportedDrive" + #: Copy failed due to service error. + OTHER_SERVICE_ERROR = "OtherServiceError" + #: Copy failed due to user error. + OTHER_USER_ERROR = "OtherUserError" + #: Copy failed due to disk detection error. + DRIVE_NOT_DETECTED = "DriveNotDetected" + #: Copy failed due to corrupted drive. + DRIVE_CORRUPTED = "DriveCorrupted" + #: Copy failed due to modified or removed metadata files. + METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" + + +class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """CustomerResolutionCode.""" + + #: No Resolution Yet + NONE = "None" + #: Clean the device + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage + RESUME = "Resume" + #: Restart whole action. + RESTART = "Restart" + #: Reach out to operation for further action. + REACH_OUT_TO_OPERATION = "ReachOutToOperation" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Data center address type.""" + + #: Data center address location. + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + #: Data center address instruction. + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + + +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.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + #: Notification at job created stage. + CREATED = "Created" + #: Notification at shipped devices to customer stage. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + #: Job created by the customer. + CREATED = "Created" + #: User shipped the device to AzureDC. + SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" + #: Awaiting shipment details of device from customer. + AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" + #: Preparing the device to ship to customer. + PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" + #: Shipped the device to customer. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the job stage.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + #: Stage has performed customer action. + CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "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 new file mode 100644 index 000000000000..552561baf5d1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_models_py3.py @@ -0,0 +1,6024 @@ +# 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 TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +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): + """ """ + 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): + """ + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str + 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): + """ + :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): + """ """ + 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): + """ """ + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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): + """ """ + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "JobCreationValidation" # type: str + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +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): + """ + :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 = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxCustomerDisk" # type: str + 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): + """ + :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 = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxCustomerDisk" # type: str + 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): + """ """ + 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 + ): + """ + :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 = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.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 + ): + """ + :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 = "DataBoxCustomerDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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_name: Account name. + :vartype account_name: 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_name": {"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_name": {"key": "accountName", "type": "str"}, + "error_log_link": {"key": "errorLogLink", "type": "str"}, + "verbose_log_link": {"key": "verboseLogLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxCustomerDisk" # type: str + self.serial_number = None + self.account_name = 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): + """ """ + 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): + """ """ + 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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str + 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 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str + 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 + ): + """ + :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 = "DataBoxHeavy" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str + 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): + """ """ + 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 + ): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "DataBox" # type: str + + +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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressInstruction" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressLocation" # type: str + 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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 = "ValidateDataTransferDetails" # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + 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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ + :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 = "DataBoxHeavy" # type: str + + +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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ManagedDisk" # type: str + 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): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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): + """ """ + 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[str]] = None, + **kwargs + ): + """ + :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 + ): + """ + :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 = "ValidatePreferences" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str + 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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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): + """ """ + 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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ValidateSkuAvailability" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str + 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): + """ """ + 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): + """ """ + 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): + """ """ + 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): + """ + :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 = "StorageAccount" # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + 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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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 + ): + """ + :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 = "ValidateAddress" # type: str + 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): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..f6ebd5ac5274 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,206 @@ +# 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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..8f358b95c661 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_jobs_operations.py @@ -0,0 +1,1676 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..b0b13430908c --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_operations.py @@ -0,0 +1,147 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..3036aac2517e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/operations/_service_operations.py @@ -0,0 +1,1058 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_12_01/py.typed @@ -0,0 +1 @@ +# 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 new file mode 100644 index 000000000000..c3f328be41df --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..e48838220bd4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 = kwargs.pop("api_version", "2022-02-01") # type: str + + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = 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 new file mode 100644 index 000000000000..9972f8d35ce6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_data_box_management_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..84542d538318 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_metadata.json @@ -0,0 +1,123 @@ +{ + "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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id. Required.", + "docstring_type": "str", + "required": true + } + }, + "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=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}", + "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 model type or a IO 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 model type or a IO 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" + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..762aed0f11ce --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_vendor.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 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: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class MixinABC(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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" 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 new file mode 100644 index 000000000000..e9ac07d95558 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..f7bd24d9c72c --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, 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 = kwargs.pop("api_version", "2022-02-01") # type: str + + 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 new file mode 100644 index 000000000000..a25602bd9f47 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_data_box_management_client.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +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(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) -> 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..8c62b2b70648 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 MixinABC(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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..db52a073c8e1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,172 @@ +# 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 MixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DataBoxManagementClientOperationsMixin(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..42e53d62a2a1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_jobs_operations.py @@ -0,0 +1,1369 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( # 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( # type: ignore + 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 = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..64eea8b78369 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..130cc94e96ad --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/aio/operations/_service_operations.py @@ -0,0 +1,872 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC + +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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..350152aece83 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/__init__.py @@ -0,0 +1,315 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..558b797103a9 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_data_box_management_client_enums.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.""" + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The address validation status.""" + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + + +class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the type of job details.""" + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk orders. + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Status of the copy.""" + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + #: No copy triggered as device was not received. + DRIVE_NOT_RECEIVED = "DriveNotReceived" + #: No copy triggered as device type is not supported. + UNSUPPORTED_DRIVE = "UnsupportedDrive" + #: Copy failed due to service error. + OTHER_SERVICE_ERROR = "OtherServiceError" + #: Copy failed due to user error. + OTHER_USER_ERROR = "OtherUserError" + #: Copy failed due to disk detection error. + DRIVE_NOT_DETECTED = "DriveNotDetected" + #: Copy failed due to corrupted drive. + DRIVE_CORRUPTED = "DriveCorrupted" + #: Copy failed due to modified or removed metadata files. + METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" + + +class CustomerResolutionCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """CustomerResolutionCode.""" + + #: No Resolution Yet + NONE = "None" + #: Clean the device + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage + RESUME = "Resume" + #: Restart whole action. + RESTART = "Restart" + #: Reach out to operation for further action. + REACH_OUT_TO_OPERATION = "ReachOutToOperation" + + +class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the account.""" + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + + +class DatacenterAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Data center address type.""" + + #: Data center address location. + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + #: Data center address instruction. + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + + +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.""" + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + + +class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the filter file.""" + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + + +class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delivery type of Job.""" + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + + +class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encryption key used for key encryption.""" + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + + +class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Level of the logs to be collected.""" + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + #: Notification at job created stage. + CREATED = "Created" + #: Notification at shipped devices to customer stage. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall validation status.""" + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + + +class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the share.""" + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + + +class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the Sku is disabled.""" + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SkuName.""" + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage which is in progress.""" + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + #: Job created by the customer. + CREATED = "Created" + #: User shipped the device to AzureDC. + SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" + #: Awaiting shipment details of device from customer. + AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" + #: Preparing the device to ship to customer. + PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" + #: Shipped the device to customer. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Holds the device erasure completion status.""" + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED = "CustomerActionPerformed" + + +class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the configuration for transfer.""" + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + + +class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the transfer.""" + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Transport Shipment Type supported for given region.""" + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + + +class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies the type of validation request.""" + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + + +class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Create order limit validation status.""" + + #: Validation is successful + VALID = "Valid" + #: Validation is not successful + INVALID = "Invalid" + #: Validation is skipped + SKIPPED = "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 new file mode 100644 index 000000000000..dd978b6798ec --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_models_py3.py @@ -0,0 +1,6084 @@ +# 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 TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +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): + """ """ + 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): + """ + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateAddress" # type: str + 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): + """ + :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): + """ """ + 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): + """ """ + 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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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): + """ """ + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "JobCreationValidation" # type: str + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +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): + """ + :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 = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateCreateOrderLimit" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxCustomerDisk" # type: str + 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): + """ + :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 = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBox" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxCustomerDisk" # type: str + 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): + """ """ + 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 + ): + """ + :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 = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.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 + ): + """ + :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 = "DataBoxCustomerDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxDisk" # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +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_name: Account name. + :vartype account_name: 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_name": {"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_name": {"key": "accountName", "type": "str"}, + "error_log_link": {"key": "errorLogLink", "type": "str"}, + "verbose_log_link": {"key": "verboseLogLink", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxCustomerDisk" # type: str + self.serial_number = None + self.account_name = 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): + """ """ + 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): + """ """ + 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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxDisk" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.copy_log_details_type = "DataBoxHeavy" # type: str + 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 + ): + """ + :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 = "DataBoxHeavy" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.job_secrets_type = "DataBoxHeavy" # type: str + 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): + """ """ + 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 + ): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = "DataBox" # type: str + 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): + """ + :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 = None # type: Optional[str] + 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): + """ + :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 = "DataBox" # type: str + + +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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = None # type: Optional[str] + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressInstruction" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.datacenter_address_type = "DatacenterAddressLocation" # type: str + 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): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 = "ValidateDataTransferDetails" # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateDataTransferDetails" # type: str + 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 + ): + """ + :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): + """ + :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): + """ """ + 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 + ): + """ + :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 = "DataBoxDisk" # type: str + 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): + """ """ + 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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ + :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 = "DataBoxHeavy" # type: str + + +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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ManagedDisk" # type: str + 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): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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 + ): + """ + :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): + """ + :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): + """ """ + 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[str]] = None, + **kwargs + ): + """ + :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 + ): + """ + :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 = "ValidatePreferences" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidatePreferences" # type: str + 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 + ): + """ + :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): + """ """ + 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 + ): + """ + :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): + """ """ + 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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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 + ): + """ + :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 = "ValidateSkuAvailability" # type: str + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSkuAvailability" # type: str + 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): + """ """ + 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): + """ """ + 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): + """ """ + 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): + """ + :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 = "StorageAccount" # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + 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): + """ """ + super().__init__(**kwargs) + self.validation_type = "ValidateSubscriptionIsAllowedToCreateJob" # type: str + 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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ + :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): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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): + """ + :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): + """ """ + 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 + ): + """ + :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 + ): + """ + :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): + """ """ + 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): + """ + :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 + ): + """ + :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 = "ValidateAddress" # type: str + 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): + """ """ + 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..6c8d256d1f9d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 * # type: ignore # 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 new file mode 100644 index 000000000000..47e40d7e5bf6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,206 @@ +# 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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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(MixinABC): + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..ecd1b1785733 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_jobs_operations.py @@ -0,0 +1,1676 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.JobResource"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. Default value is None. + :type skip_token: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResourceList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # 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 = { + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource: Job details from request body. Required. + :type job_resource: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( # 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobResource]] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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}"} # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: _models.JobResourceUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. Required. + :type job_resource_update_parameter: + ~azure.mgmt.databox.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 + model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.JobResource] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( # type: ignore + 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 = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + 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) + + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"} # type: ignore + + @overload + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: _models.ShipmentPickUpRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ShipmentPickUpResponse: + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. Required. + :type shipment_pick_up_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ShipmentPickUpResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @distributed_trace + def list_credentials( + self, resource_group_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentials"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param job_name: The name of the job Resource within the specified resource group. job names + must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + Required. + :type job_name: str + :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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.UnencryptedCredentialsList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..7c5935fce213 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_operations.py @@ -0,0 +1,147 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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 new file mode 100644 index 000000000000..7212f139615b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/operations/_service_operations.py @@ -0,0 +1,1058 @@ +# 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 +from urllib.parse import parse_qs, urljoin, urlparse + +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 MixinABC, _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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 = _format_url_section(_url, **path_format_arguments) + + # 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableSkusResult] + + 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) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_address( + self, + location: str, + validate_address: _models.ValidateAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AddressValidationOutput: + """[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer + shipping address and provide alternate addresses if any. + + :param location: The 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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AddressValidationOutput] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def validate_inputs( + self, + location: str, + validation_request: _models.ValidationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidationResponse: + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. Required. + :type location: str + :param validation_request: Inputs of the customer. Required. + :type validation_request: ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ValidationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration( + self, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore + + @overload + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: _models.RegionConfigurationRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RegionConfigurationResponse: + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. Required. + :type resource_group_name: str + :param location: The location of the resource. Required. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. Required. + :type region_configuration_request: + ~azure.mgmt.databox.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 model 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RegionConfigurationResponse] + + 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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.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"} # type: ignore 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 new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2022_02_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file