From db4b72cc5e249ad03d7f5eb5ae0b648e9426ba09 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 21 Jan 2021 11:13:20 +0000 Subject: [PATCH] CodeGen from PR 12543 in Azure/azure-rest-api-specs Merge cfaa6c8bda15abfbe9246acfb01351f45e028a73 into 6faa9f0d067a67b6e41c0a3598fa05603c411abf --- .../storage/_storage_management_client.py | 81 + .../storage/aio/_storage_management_client.py | 81 + .../mgmt/storage/v2015_06_15/_metadata.json | 15 +- .../v2015_06_15/_storage_management.py | 1 - .../v2015_06_15/aio/_storage_management.py | 1 - .../_storage_accounts_operations.py | 58 +- .../aio/operations/_usage_operations.py | 8 +- .../_storage_accounts_operations.py | 58 +- .../operations/_usage_operations.py | 8 +- .../mgmt/storage/v2016_01_01/_metadata.json | 15 +- .../v2016_01_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../_storage_accounts_operations.py | 58 +- .../aio/operations/_usage_operations.py | 8 +- .../_storage_accounts_operations.py | 58 +- .../operations/_usage_operations.py | 8 +- .../mgmt/storage/v2016_12_01/_metadata.json | 15 +- .../v2016_12_01/_storage_management.py | 1 - .../v2016_12_01/aio/_storage_management.py | 1 - .../_storage_accounts_operations.py | 70 +- .../aio/operations/_usage_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../operations/_usage_operations.py | 8 +- .../mgmt/storage/v2017_06_01/_metadata.json | 15 +- .../v2017_06_01/_storage_management.py | 1 - .../v2017_06_01/aio/_storage_management.py | 1 - .../v2017_06_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../aio/operations/_usage_operations.py | 8 +- .../v2017_06_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../operations/_usage_operations.py | 8 +- .../mgmt/storage/v2017_10_01/_metadata.json | 15 +- .../v2017_10_01/_storage_management.py | 1 - .../v2017_10_01/aio/_storage_management.py | 1 - .../v2017_10_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../aio/operations/_usage_operations.py | 8 +- .../v2017_10_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../operations/_usage_operations.py | 8 +- .../mgmt/storage/v2018_02_01/_metadata.json | 15 +- .../v2018_02_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 66 +- .../v2018_02_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../aio/operations/_usage_operations.py | 12 +- .../storage/v2018_02_01/models/_models.py | 48 +- .../storage/v2018_02_01/models/_models_py3.py | 48 +- .../operations/_blob_containers_operations.py | 66 +- .../v2018_02_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 70 +- .../operations/_usage_operations.py | 12 +- .../v2018_03_01_preview/_metadata.json | 15 +- .../_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 66 +- .../aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 86 +- .../aio/operations/_usages_operations.py | 12 +- .../v2018_03_01_preview/models/_models.py | 54 +- .../v2018_03_01_preview/models/_models_py3.py | 54 +- .../operations/_blob_containers_operations.py | 66 +- .../operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 86 +- .../operations/_usages_operations.py | 12 +- .../mgmt/storage/v2018_07_01/_metadata.json | 15 +- .../v2018_07_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 14 +- .../_management_policies_operations.py | 20 +- .../v2018_07_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../aio/operations/_usages_operations.py | 8 +- .../storage/v2018_07_01/models/_models.py | 60 +- .../storage/v2018_07_01/models/_models_py3.py | 60 +- .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 14 +- .../_management_policies_operations.py | 20 +- .../v2018_07_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../operations/_usages_operations.py | 8 +- .../mgmt/storage/v2018_11_01/_metadata.json | 15 +- .../v2018_11_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 14 +- .../_management_policies_operations.py | 20 +- .../v2018_11_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../aio/operations/_usages_operations.py | 8 +- .../storage/v2018_11_01/models/_models.py | 60 +- .../storage/v2018_11_01/models/_models_py3.py | 60 +- .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 14 +- .../_management_policies_operations.py | 20 +- .../v2018_11_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../operations/_usages_operations.py | 8 +- .../mgmt/storage/v2019_04_01/_metadata.json | 15 +- .../v2019_04_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 18 +- .../operations/_file_services_operations.py | 18 +- .../aio/operations/_file_shares_operations.py | 24 +- .../_management_policies_operations.py | 20 +- .../v2019_04_01/aio/operations/_operations.py | 8 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../aio/operations/_usages_operations.py | 8 +- .../storage/v2019_04_01/models/_models.py | 78 +- .../storage/v2019_04_01/models/_models_py3.py | 78 +- .../operations/_blob_containers_operations.py | 66 +- .../operations/_blob_services_operations.py | 18 +- .../operations/_file_services_operations.py | 18 +- .../operations/_file_shares_operations.py | 24 +- .../_management_policies_operations.py | 20 +- .../v2019_04_01/operations/_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 78 +- .../operations/_usages_operations.py | 8 +- .../mgmt/storage/v2019_06_01/_metadata.json | 15 +- .../v2019_06_01/_storage_management_client.py | 1 - .../aio/_storage_management_client.py | 1 - .../operations/_blob_containers_operations.py | 68 +- .../operations/_blob_services_operations.py | 18 +- .../_encryption_scopes_operations.py | 30 +- .../operations/_file_services_operations.py | 18 +- .../aio/operations/_file_shares_operations.py | 26 +- .../_management_policies_operations.py | 20 +- ..._object_replication_policies_operations.py | 26 +- .../v2019_06_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 24 +- .../_private_link_resources_operations.py | 8 +- .../aio/operations/_queue_operations.py | 24 +- .../operations/_queue_services_operations.py | 18 +- .../aio/operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 100 +- .../aio/operations/_table_operations.py | 20 +- .../operations/_table_services_operations.py | 18 +- .../aio/operations/_usages_operations.py | 8 +- .../storage/v2019_06_01/models/_models.py | 132 +- .../storage/v2019_06_01/models/_models_py3.py | 132 +- .../operations/_blob_containers_operations.py | 68 +- .../operations/_blob_services_operations.py | 18 +- .../_encryption_scopes_operations.py | 30 +- .../operations/_file_services_operations.py | 18 +- .../operations/_file_shares_operations.py | 26 +- .../_management_policies_operations.py | 20 +- ..._object_replication_policies_operations.py | 26 +- .../v2019_06_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 24 +- .../_private_link_resources_operations.py | 8 +- .../operations/_queue_operations.py | 24 +- .../operations/_queue_services_operations.py | 18 +- .../operations/_skus_operations.py | 8 +- .../_storage_accounts_operations.py | 100 +- .../operations/_table_operations.py | 20 +- .../operations/_table_services_operations.py | 18 +- .../operations/_usages_operations.py | 8 +- .../storage/v2020_08_01_preview/__init__.py | 16 + .../v2020_08_01_preview/_configuration.py | 70 + .../v2020_08_01_preview/_metadata.json | 79 + .../_storage_management_client.py | 159 + .../v2020_08_01_preview/aio/__init__.py | 10 + .../v2020_08_01_preview/aio/_configuration.py | 66 + .../aio/_storage_management_client.py | 153 + .../aio/operations/__init__.py | 49 + .../operations/_blob_containers_operations.py | 1082 ++++ .../_blob_inventory_policies_operations.py | 326 + .../operations/_blob_services_operations.py | 256 + .../_deleted_accounts_operations.py | 168 + .../_encryption_scopes_operations.py | 349 ++ .../operations/_file_services_operations.py | 239 + .../aio/operations/_file_shares_operations.py | 521 ++ .../_management_policies_operations.py | 242 + ..._object_replication_policies_operations.py | 327 + .../aio/operations/_operations.py | 104 + ...private_endpoint_connections_operations.py | 325 + .../_private_link_resources_operations.py | 102 + .../aio/operations/_queue_operations.py | 416 ++ .../operations/_queue_services_operations.py | 239 + .../aio/operations/_skus_operations.py | 108 + .../_storage_accounts_operations.py | 1150 ++++ .../aio/operations/_table_operations.py | 384 ++ .../operations/_table_services_operations.py | 239 + .../aio/operations/_usages_operations.py | 113 + .../v2020_08_01_preview/models/__init__.py | 493 ++ .../v2020_08_01_preview/models/_models.py | 5125 +++++++++++++++ .../v2020_08_01_preview/models/_models_py3.py | 5502 +++++++++++++++++ .../_storage_management_client_enums.py | 448 ++ .../operations/__init__.py | 49 + .../operations/_blob_containers_operations.py | 1099 ++++ .../_blob_inventory_policies_operations.py | 334 + .../operations/_blob_services_operations.py | 263 + .../_deleted_accounts_operations.py | 174 + .../_encryption_scopes_operations.py | 357 ++ .../operations/_file_services_operations.py | 246 + .../operations/_file_shares_operations.py | 531 ++ .../_management_policies_operations.py | 249 + ..._object_replication_policies_operations.py | 335 + .../operations/_operations.py | 109 + ...private_endpoint_connections_operations.py | 333 + .../_private_link_resources_operations.py | 107 + .../operations/_queue_operations.py | 425 ++ .../operations/_queue_services_operations.py | 246 + .../operations/_skus_operations.py | 113 + .../_storage_accounts_operations.py | 1171 ++++ .../operations/_table_operations.py | 393 ++ .../operations/_table_services_operations.py | 246 + .../operations/_usages_operations.py | 118 + .../mgmt/storage/v2020_08_01_preview/py.typed | 1 + 227 files changed, 28373 insertions(+), 2271 deletions(-) create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_metadata.json create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_configuration.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_storage_management_client.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_inventory_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/py.typed diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py index 73a2f6cbf8416..9fbf708b0fd52 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py @@ -93,6 +93,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2018-11-01: :mod:`v2018_11_01.models` * 2019-04-01: :mod:`v2019_04_01.models` * 2019-06-01: :mod:`v2019_06_01.models` + * 2020-08-01-preview: :mod:`v2020_08_01_preview.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-06-01': from .v2019_06_01 import models return models + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -139,6 +143,7 @@ def blob_containers(self): * 2018-11-01: :class:`BlobContainersOperations` * 2019-04-01: :class:`BlobContainersOperations` * 2019-06-01: :class:`BlobContainersOperations` + * 2020-08-01-preview: :class:`BlobContainersOperations` """ api_version = self._get_api_version('blob_containers') if api_version == '2018-02-01': @@ -153,10 +158,25 @@ def blob_containers(self): from .v2019_04_01.operations import BlobContainersOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import BlobContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def blob_inventory_policies(self): + """Instance depends on the API version: + + * 2020-08-01-preview: :class:`BlobInventoryPoliciesOperations` + """ + api_version = self._get_api_version('blob_inventory_policies') + if api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import BlobInventoryPoliciesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def blob_services(self): """Instance depends on the API version: @@ -165,6 +185,7 @@ def blob_services(self): * 2018-11-01: :class:`BlobServicesOperations` * 2019-04-01: :class:`BlobServicesOperations` * 2019-06-01: :class:`BlobServicesOperations` + * 2020-08-01-preview: :class:`BlobServicesOperations` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': @@ -175,19 +196,37 @@ def blob_services(self): from .v2019_04_01.operations import BlobServicesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import BlobServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def deleted_accounts(self): + """Instance depends on the API version: + + * 2020-08-01-preview: :class:`DeletedAccountsOperations` + """ + api_version = self._get_api_version('deleted_accounts') + if api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import DeletedAccountsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def encryption_scopes(self): """Instance depends on the API version: * 2019-06-01: :class:`EncryptionScopesOperations` + * 2020-08-01-preview: :class:`EncryptionScopesOperations` """ api_version = self._get_api_version('encryption_scopes') if api_version == '2019-06-01': from .v2019_06_01.operations import EncryptionScopesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import EncryptionScopesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -198,12 +237,15 @@ def file_services(self): * 2019-04-01: :class:`FileServicesOperations` * 2019-06-01: :class:`FileServicesOperations` + * 2020-08-01-preview: :class:`FileServicesOperations` """ api_version = self._get_api_version('file_services') if api_version == '2019-04-01': from .v2019_04_01.operations import FileServicesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import FileServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import FileServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -214,12 +256,15 @@ def file_shares(self): * 2019-04-01: :class:`FileSharesOperations` * 2019-06-01: :class:`FileSharesOperations` + * 2020-08-01-preview: :class:`FileSharesOperations` """ api_version = self._get_api_version('file_shares') if api_version == '2019-04-01': from .v2019_04_01.operations import FileSharesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import FileSharesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import FileSharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -232,6 +277,7 @@ def management_policies(self): * 2018-11-01: :class:`ManagementPoliciesOperations` * 2019-04-01: :class:`ManagementPoliciesOperations` * 2019-06-01: :class:`ManagementPoliciesOperations` + * 2020-08-01-preview: :class:`ManagementPoliciesOperations` """ api_version = self._get_api_version('management_policies') if api_version == '2018-07-01': @@ -242,6 +288,8 @@ def management_policies(self): from .v2019_04_01.operations import ManagementPoliciesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import ManagementPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -251,10 +299,13 @@ def object_replication_policies(self): """Instance depends on the API version: * 2019-06-01: :class:`ObjectReplicationPoliciesOperations` + * 2020-08-01-preview: :class:`ObjectReplicationPoliciesOperations` """ api_version = self._get_api_version('object_replication_policies') if api_version == '2019-06-01': from .v2019_06_01.operations import ObjectReplicationPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import ObjectReplicationPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -271,6 +322,7 @@ def operations(self): * 2018-11-01: :class:`Operations` * 2019-04-01: :class:`Operations` * 2019-06-01: :class:`Operations` + * 2020-08-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -289,6 +341,8 @@ def operations(self): from .v2019_04_01.operations import Operations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import Operations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -298,10 +352,13 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-08-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-06-01': from .v2019_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -311,10 +368,13 @@ def private_link_resources(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateLinkResourcesOperations` + * 2020-08-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-06-01': from .v2019_06_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -324,10 +384,13 @@ def queue(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueOperations` + * 2020-08-01-preview: :class:`QueueOperations` """ api_version = self._get_api_version('queue') if api_version == '2019-06-01': from .v2019_06_01.operations import QueueOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import QueueOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -337,10 +400,13 @@ def queue_services(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueServicesOperations` + * 2020-08-01-preview: :class:`QueueServicesOperations` """ api_version = self._get_api_version('queue_services') if api_version == '2019-06-01': from .v2019_06_01.operations import QueueServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import QueueServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -357,6 +423,7 @@ def skus(self): * 2018-11-01: :class:`SkusOperations` * 2019-04-01: :class:`SkusOperations` * 2019-06-01: :class:`SkusOperations` + * 2020-08-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -375,6 +442,8 @@ def skus(self): from .v2019_04_01.operations import SkusOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import SkusOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -394,6 +463,7 @@ def storage_accounts(self): * 2018-11-01: :class:`StorageAccountsOperations` * 2019-04-01: :class:`StorageAccountsOperations` * 2019-06-01: :class:`StorageAccountsOperations` + * 2020-08-01-preview: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -418,6 +488,8 @@ def storage_accounts(self): from .v2019_04_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -427,10 +499,13 @@ def table(self): """Instance depends on the API version: * 2019-06-01: :class:`TableOperations` + * 2020-08-01-preview: :class:`TableOperations` """ api_version = self._get_api_version('table') if api_version == '2019-06-01': from .v2019_06_01.operations import TableOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import TableOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -440,10 +515,13 @@ def table_services(self): """Instance depends on the API version: * 2019-06-01: :class:`TableServicesOperations` + * 2020-08-01-preview: :class:`TableServicesOperations` """ api_version = self._get_api_version('table_services') if api_version == '2019-06-01': from .v2019_06_01.operations import TableServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import TableServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -485,6 +563,7 @@ def usages(self): * 2018-11-01: :class:`UsagesOperations` * 2019-04-01: :class:`UsagesOperations` * 2019-06-01: :class:`UsagesOperations` + * 2020-08-01-preview: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': @@ -497,6 +576,8 @@ def usages(self): from .v2019_04_01.operations import UsagesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import UsagesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".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/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py index b321b6e212d8f..7b10330b7e393 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py @@ -93,6 +93,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2018-11-01: :mod:`v2018_11_01.models` * 2019-04-01: :mod:`v2019_04_01.models` * 2019-06-01: :mod:`v2019_06_01.models` + * 2020-08-01-preview: :mod:`v2020_08_01_preview.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-06-01': from ..v2019_06_01 import models return models + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -139,6 +143,7 @@ def blob_containers(self): * 2018-11-01: :class:`BlobContainersOperations` * 2019-04-01: :class:`BlobContainersOperations` * 2019-06-01: :class:`BlobContainersOperations` + * 2020-08-01-preview: :class:`BlobContainersOperations` """ api_version = self._get_api_version('blob_containers') if api_version == '2018-02-01': @@ -153,10 +158,25 @@ def blob_containers(self): from ..v2019_04_01.aio.operations import BlobContainersOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import BlobContainersOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import BlobContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def blob_inventory_policies(self): + """Instance depends on the API version: + + * 2020-08-01-preview: :class:`BlobInventoryPoliciesOperations` + """ + api_version = self._get_api_version('blob_inventory_policies') + if api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import BlobInventoryPoliciesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def blob_services(self): """Instance depends on the API version: @@ -165,6 +185,7 @@ def blob_services(self): * 2018-11-01: :class:`BlobServicesOperations` * 2019-04-01: :class:`BlobServicesOperations` * 2019-06-01: :class:`BlobServicesOperations` + * 2020-08-01-preview: :class:`BlobServicesOperations` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': @@ -175,19 +196,37 @@ def blob_services(self): from ..v2019_04_01.aio.operations import BlobServicesOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import BlobServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import BlobServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def deleted_accounts(self): + """Instance depends on the API version: + + * 2020-08-01-preview: :class:`DeletedAccountsOperations` + """ + api_version = self._get_api_version('deleted_accounts') + if api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import DeletedAccountsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def encryption_scopes(self): """Instance depends on the API version: * 2019-06-01: :class:`EncryptionScopesOperations` + * 2020-08-01-preview: :class:`EncryptionScopesOperations` """ api_version = self._get_api_version('encryption_scopes') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import EncryptionScopesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import EncryptionScopesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -198,12 +237,15 @@ def file_services(self): * 2019-04-01: :class:`FileServicesOperations` * 2019-06-01: :class:`FileServicesOperations` + * 2020-08-01-preview: :class:`FileServicesOperations` """ api_version = self._get_api_version('file_services') if api_version == '2019-04-01': from ..v2019_04_01.aio.operations import FileServicesOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import FileServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import FileServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -214,12 +256,15 @@ def file_shares(self): * 2019-04-01: :class:`FileSharesOperations` * 2019-06-01: :class:`FileSharesOperations` + * 2020-08-01-preview: :class:`FileSharesOperations` """ api_version = self._get_api_version('file_shares') if api_version == '2019-04-01': from ..v2019_04_01.aio.operations import FileSharesOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import FileSharesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import FileSharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -232,6 +277,7 @@ def management_policies(self): * 2018-11-01: :class:`ManagementPoliciesOperations` * 2019-04-01: :class:`ManagementPoliciesOperations` * 2019-06-01: :class:`ManagementPoliciesOperations` + * 2020-08-01-preview: :class:`ManagementPoliciesOperations` """ api_version = self._get_api_version('management_policies') if api_version == '2018-07-01': @@ -242,6 +288,8 @@ def management_policies(self): from ..v2019_04_01.aio.operations import ManagementPoliciesOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import ManagementPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -251,10 +299,13 @@ def object_replication_policies(self): """Instance depends on the API version: * 2019-06-01: :class:`ObjectReplicationPoliciesOperations` + * 2020-08-01-preview: :class:`ObjectReplicationPoliciesOperations` """ api_version = self._get_api_version('object_replication_policies') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import ObjectReplicationPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -271,6 +322,7 @@ def operations(self): * 2018-11-01: :class:`Operations` * 2019-04-01: :class:`Operations` * 2019-06-01: :class:`Operations` + * 2020-08-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -289,6 +341,8 @@ def operations(self): from ..v2019_04_01.aio.operations import Operations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import Operations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.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))) @@ -298,10 +352,13 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-08-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -311,10 +368,13 @@ def private_link_resources(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateLinkResourcesOperations` + * 2020-08-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -324,10 +384,13 @@ def queue(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueOperations` + * 2020-08-01-preview: :class:`QueueOperations` """ api_version = self._get_api_version('queue') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import QueueOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import QueueOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -337,10 +400,13 @@ def queue_services(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueServicesOperations` + * 2020-08-01-preview: :class:`QueueServicesOperations` """ api_version = self._get_api_version('queue_services') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import QueueServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import QueueServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -357,6 +423,7 @@ def skus(self): * 2018-11-01: :class:`SkusOperations` * 2019-04-01: :class:`SkusOperations` * 2019-06-01: :class:`SkusOperations` + * 2020-08-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -375,6 +442,8 @@ def skus(self): from ..v2019_04_01.aio.operations import SkusOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import SkusOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -394,6 +463,7 @@ def storage_accounts(self): * 2018-11-01: :class:`StorageAccountsOperations` * 2019-04-01: :class:`StorageAccountsOperations` * 2019-06-01: :class:`StorageAccountsOperations` + * 2020-08-01-preview: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -418,6 +488,8 @@ def storage_accounts(self): from ..v2019_04_01.aio.operations import StorageAccountsOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -427,10 +499,13 @@ def table(self): """Instance depends on the API version: * 2019-06-01: :class:`TableOperations` + * 2020-08-01-preview: :class:`TableOperations` """ api_version = self._get_api_version('table') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import TableOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import TableOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -440,10 +515,13 @@ def table_services(self): """Instance depends on the API version: * 2019-06-01: :class:`TableServicesOperations` + * 2020-08-01-preview: :class:`TableServicesOperations` """ api_version = self._get_api_version('table_services') if api_version == '2019-06-01': from ..v2019_06_01.aio.operations import TableServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import TableServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -485,6 +563,7 @@ def usages(self): * 2018-11-01: :class:`UsagesOperations` * 2019-04-01: :class:`UsagesOperations` * 2019-06-01: :class:`UsagesOperations` + * 2020-08-01-preview: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': @@ -497,6 +576,8 @@ def usages(self): from ..v2019_04_01.aio.operations import UsagesOperations as OperationClass elif api_version == '2019-06-01': from ..v2019_06_01.aio.operations import UsagesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from ..v2020_08_01_preview.aio.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".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/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_metadata.json index 33b356e0b5033..65ad4e941c34d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management.py index ee9e1bfca7795..296ef8616a529 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management.py @@ -53,7 +53,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/_storage_management.py index cde5ee5b55b56..3a84993df386a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/_storage_management.py @@ -50,7 +50,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py index 8aa13a65f33d9..66bfb9c52b47d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2015_06_15.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountKeys": + ) -> "_models.StorageAccountKeys": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountKeys": + ) -> "_models.StorageAccountKeys": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py index e920e3f795ba2..29594b6d85dc4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Lists the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py index 4fc7713ca81f9..9ca14eb4ea9ae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2015_06_15.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountKeys" + # type: (...) -> "_models.StorageAccountKeys" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountKeys" + # type: (...) -> "_models.StorageAccountKeys" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py index b6b2280288df0..874c1311ea5c4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Lists the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2015_06_15.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_metadata.json index d523f2c674674..2c9f934f3be77 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py index 085ec5595c535..1cdc1a0d33e3c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py @@ -53,7 +53,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py index 41c24f2906757..e2dd7b8166e3a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py @@ -50,7 +50,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py index ad5ebfb3afd4b..ea06538a90bfd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -189,7 +189,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -214,7 +214,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -288,7 +294,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -304,7 +310,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +355,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -374,7 +380,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -432,7 +438,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,7 +497,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -502,7 +508,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -563,7 +569,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. @@ -577,7 +583,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,9 +628,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. @@ -640,7 +646,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py index 6c8d7cc63b7d8..52dc9615d6e4f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py index d298479b656bc..2f0b2dff4aaeb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -196,7 +196,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -221,7 +221,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -297,7 +303,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -313,7 +319,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +364,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -384,7 +390,7 @@ def update( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,7 +440,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -443,7 +449,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -503,7 +509,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -514,7 +520,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -576,7 +582,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. @@ -590,7 +596,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,10 +641,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. @@ -654,7 +660,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py index f8cee9efbd57d..12abbf330c1ee 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_01_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_metadata.json index 02bc723ddbcf7..947992b66f0fd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management.py index 7d9ecc6dea3c5..023e9cf46d645 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management.py @@ -53,7 +53,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/_storage_management.py index a32af010e1577..6f1f50bbd09d2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/_storage_management.py @@ -50,7 +50,6 @@ def __init__( 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.storage_accounts = StorageAccountsOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py index 9dfa75c9c753a..c41453e143a0a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2016_12_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,9 +703,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -716,7 +722,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,9 +772,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -785,7 +791,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py index 344c387695098..0095b14fb85eb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_12_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py index 17600678ce29c..24bdc0cf9e49c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2016_12_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,10 +717,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -731,7 +737,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +787,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -801,7 +807,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py index 15c278fe74ef9..41da5c54a5d18 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_12_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_metadata.json index 04dadd3f6e428..a2f71fa470468 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management.py index f25c8d687821d..76b809b573928 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management.py @@ -59,7 +59,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/_storage_management.py index f3b431560958b..f39e6622fa686 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/_storage_management.py @@ -56,7 +56,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py index 19dac955be849..1fe7969577bda 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py index 2b5b1950e9f51..5fd123a5b6112 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py index e63fddd4ec95d..7d50bb3ab02e6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2017_06_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,9 +703,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -716,7 +722,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,9 +772,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -785,7 +791,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py index 904c0e1fa6cac..61882126fc10e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py index 1748ba1c6e969..c4e8c53feb58f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py index fa8bf1dbac795..2878e851de874 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py index a060707894b09..af697e317a6a9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2017_06_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,10 +717,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -731,7 +737,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +787,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -801,7 +807,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py index 7da2d0f7a65fd..b8e9bd93da758 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_06_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_metadata.json index 15d823905b8eb..fc29e2980d5b4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management.py index 931b6ca43d888..e545131c0180e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management.py @@ -59,7 +59,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/_storage_management.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/_storage_management.py index e022276384bf4..f1b5652ea33da 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/_storage_management.py @@ -56,7 +56,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py index 270f8a1f5ca66..9fc993a2392ac 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py index 3a24ef4a85744..daab3859df0f1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py index 4f268118fcffd..319eaffb37875 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,9 +703,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -716,7 +722,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,9 +772,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -785,7 +791,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py index fd2e55b48d4c0..bdc9f7d621b46 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py index 5fe5665e6662b..dd286793eb483 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py index 1dfe67d0e494e..26d4f4ee98432 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py index e9b3d182649e9..5ea0eccf2dddd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,10 +717,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -731,7 +737,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +787,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -801,7 +807,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py index b18d7fdd0a0f9..e332398eda319 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_metadata.json index 5fd1ad8ac4556..a4c2c096a4f22 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py index 20d52c9eea4df..744ffdaa4875b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py @@ -62,7 +62,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/_storage_management_client.py index 85789332cf9ba..f7ca8196999f7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/_storage_management_client.py @@ -59,7 +59,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py index 2be179b47b060..fd7a526343530 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListContainerItems": + ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -61,7 +61,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -133,7 +133,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,9 +185,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -210,7 +210,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,7 +263,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -283,7 +283,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,9 +393,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -419,7 +419,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,9 +471,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -496,7 +496,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,9 +549,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -579,7 +579,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,7 +642,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -667,7 +667,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,7 +722,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -749,7 +749,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +803,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -828,7 +828,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,9 +879,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -910,7 +910,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +968,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -993,7 +993,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py index 63575b9e8ca27..8f032f550b45d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py index 1851cec43f8d0..c962a2c29279c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py index 3e085c95ac172..4e7b252d96110 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,9 +703,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -716,7 +722,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,9 +772,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -785,7 +791,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py index d61b3244d058c..8c77fa0feeffa 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -122,7 +122,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_02_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py index 01a5f50576199..335646bcede6d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py @@ -75,17 +75,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -112,17 +112,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -155,13 +155,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -539,13 +539,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -853,13 +853,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1414,19 +1414,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1465,13 +1465,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py index 1f3dc98ae006b..3b5f2f40c1e34 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py @@ -89,17 +89,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -126,17 +126,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -169,13 +169,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -571,13 +571,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -908,13 +908,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1527,19 +1527,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1581,13 +1581,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py index 9d559256d5bda..d64b2abf6d756 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListContainerItems" + # type: (...) -> "_models.ListContainerItems" """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -66,7 +66,7 @@ def list( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -139,7 +139,7 @@ def create( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,10 +191,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -217,7 +217,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,7 +271,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -291,7 +291,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,10 +402,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -429,7 +429,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,10 +481,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -507,7 +507,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -560,10 +560,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -591,7 +591,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +655,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -680,7 +680,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -736,7 +736,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -763,7 +763,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -818,7 +818,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -843,7 +843,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -894,10 +894,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -926,7 +926,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,10 +984,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1010,7 +1010,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py index 9ffd57bb7a9e9..f35f77e881ea0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py index 08dcb635af1f2..effa8fb43cc91 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py index 571420f578158..60859f4046060 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,10 +717,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -731,7 +737,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +787,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -801,7 +807,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py index 31ba7041841bc..fad16b17f7c2e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -128,7 +128,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_02_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_metadata.json index 1415976cf18f3..3849ffc618851 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py index ed79d2302ebe0..d595b464d0109 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py @@ -62,7 +62,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/_storage_management_client.py index 1c92a1109ef81..653656bd45f6b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/_storage_management_client.py @@ -59,7 +59,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py index c623eae55340d..c484b64b82bba 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListContainerItems": + ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -61,7 +61,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -133,7 +133,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,9 +185,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -210,7 +210,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,7 +263,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -283,7 +283,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,9 +393,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -419,7 +419,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,9 +471,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -496,7 +496,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,9 +549,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -579,7 +579,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,7 +642,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -667,7 +667,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,7 +722,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -749,7 +749,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +803,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -828,7 +828,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,9 +879,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -910,7 +910,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +968,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -993,7 +993,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py index 7e2a679bad175..8acaf370503ee 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py index e0e8cb87cd3a2..a253f1b1bae84 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py index 54b11524ea243..83a18f73e169b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -290,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -307,7 +313,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,9 +358,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -378,7 +384,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -436,7 +442,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +513,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -568,7 +574,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -583,7 +589,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,9 +634,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -647,7 +653,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,9 +703,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -716,7 +722,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,9 +772,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -785,7 +791,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,9 +841,9 @@ async def get_management_policies( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs - ) -> "models.StorageAccountManagementPolicies": + ) -> "_models.StorageAccountManagementPolicies": """Gets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -855,7 +861,7 @@ async def get_management_policies( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -901,10 +907,10 @@ async def create_or_update_management_policies( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], - properties: "models.ManagementPoliciesRulesSetParameter", + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPoliciesRulesSetParameter", **kwargs - ) -> "models.StorageAccountManagementPolicies": + ) -> "_models.StorageAccountManagementPolicies": """Sets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -924,7 +930,7 @@ async def create_or_update_management_policies( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -975,7 +981,7 @@ async def delete_management_policies( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs ) -> None: """Deletes the data policy rules associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py index 68b06111328f6..6b1f688f21ccb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -122,7 +122,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py index 42b4a497ff2d0..88c30fb9e1cf4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py @@ -75,17 +75,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -112,17 +112,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -155,13 +155,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -539,13 +539,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -854,13 +854,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1458,19 +1458,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1509,13 +1509,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1852,13 +1852,13 @@ class StorageAccountManagementPolicies(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py index d4b3564093e63..1398f13ba7514 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py @@ -89,17 +89,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -126,17 +126,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -169,13 +169,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -571,13 +571,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -909,13 +909,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1575,19 +1575,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1629,13 +1629,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1992,13 +1992,13 @@ class StorageAccountManagementPolicies(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py index cf636dae04d08..9c55e573cbb95 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListContainerItems" + # type: (...) -> "_models.ListContainerItems" """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -66,7 +66,7 @@ def list( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -139,7 +139,7 @@ def create( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,10 +191,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -217,7 +217,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,7 +271,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -291,7 +291,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,10 +402,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -429,7 +429,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,10 +481,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -507,7 +507,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -560,10 +560,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -591,7 +591,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +655,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -680,7 +680,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -736,7 +736,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -763,7 +763,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -818,7 +818,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -843,7 +843,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -894,10 +894,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -926,7 +926,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,10 +984,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1010,7 +1010,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py index 6d030c5828f39..6d68c52723b47 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py index 59572fa38522e..fd75156fc7f6a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py index 0a3fb62848015..b4193df535034 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -299,7 +305,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +322,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,10 +367,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -388,7 +394,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +444,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -447,7 +453,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +513,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -519,7 +525,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +587,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -596,7 +602,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,10 +647,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,10 +717,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -731,7 +737,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +787,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -801,7 +807,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,10 +857,10 @@ def get_management_policies( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountManagementPolicies" + # type: (...) -> "_models.StorageAccountManagementPolicies" """Gets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -872,7 +878,7 @@ def get_management_policies( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,11 +924,11 @@ def create_or_update_management_policies( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] - properties, # type: "models.ManagementPoliciesRulesSetParameter" + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPoliciesRulesSetParameter" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountManagementPolicies" + # type: (...) -> "_models.StorageAccountManagementPolicies" """Sets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -942,7 +948,7 @@ def create_or_update_management_policies( :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -993,7 +999,7 @@ def delete_management_policies( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py index 6994ae8301916..e2cfb72fccde2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -128,7 +128,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_03_01_preview.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_metadata.json index 301d5c2de4a59..cdb37866341aa 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py index 11055782e2df6..9ca9e2b2e271c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py @@ -68,7 +68,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/_storage_management_client.py index b6f8cf96c4e36..7039184e3b2e6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/_storage_management_client.py @@ -65,7 +65,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py index 73833b6ba2b3b..132e90e7cf05b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListContainerItems": + ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -61,7 +61,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -133,7 +133,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,9 +185,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -210,7 +210,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,7 +263,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -283,7 +283,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,9 +393,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -419,7 +419,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,9 +471,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -496,7 +496,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,9 +549,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -579,7 +579,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,7 +642,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -667,7 +667,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,7 +722,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -749,7 +749,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +803,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -828,7 +828,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,9 +879,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -910,7 +910,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +968,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -993,7 +993,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py index 7e4e5661cfc06..0886db6a25629 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.BlobServiceProperties", + parameters: "_models.BlobServiceProperties", **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -65,7 +65,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -134,7 +134,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py index 6b75e19f48dac..374f81a1c4832 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ManagementPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def get( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs - ) -> "models.StorageAccountManagementPolicies": + ) -> "_models.StorageAccountManagementPolicies": """Gets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], - properties: "models.ManagementPoliciesRulesSetParameter", + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPoliciesRulesSetParameter", **kwargs - ) -> "models.StorageAccountManagementPolicies": + ) -> "_models.StorageAccountManagementPolicies": """Sets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -133,7 +133,7 @@ async def create_or_update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def delete( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs ) -> None: """Deletes the data policy rules associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py index 3bf4591ad8934..a899d4a9d2372 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py index 52e07c8cbd59e..fcfd305907982 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py index 9053914922793..90ddcc01ddec9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_07_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -291,7 +297,7 @@ async def get_properties( account_name: str, expand: Optional[str] = "geoReplicationStats", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -311,7 +317,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +364,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -384,7 +390,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,7 +439,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -442,7 +448,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +507,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -513,7 +519,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +580,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -589,7 +595,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -634,9 +640,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -653,7 +659,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,9 +709,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -722,7 +728,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -772,9 +778,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -791,7 +797,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -928,7 +934,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py index f232bb0906a5b..1f067a6c2b6ba 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -56,7 +56,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_07_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py index 6ac4738c5019f..12ea94e470611 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py @@ -75,17 +75,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -112,17 +112,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -155,13 +155,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -251,13 +251,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -732,13 +732,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1046,13 +1046,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1647,19 +1647,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1698,13 +1698,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -2061,13 +2061,13 @@ class StorageAccountManagementPolicies(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py index cb194474cf778..cefded6366784 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py @@ -89,17 +89,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -126,17 +126,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -169,13 +169,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -268,13 +268,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -779,13 +779,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1116,13 +1116,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1779,19 +1779,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1833,13 +1833,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -2218,13 +2218,13 @@ class StorageAccountManagementPolicies(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py index c979424fc1de8..0e9f3ba518ade 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListContainerItems" + # type: (...) -> "_models.ListContainerItems" """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -66,7 +66,7 @@ def list( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -139,7 +139,7 @@ def create( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,10 +191,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -217,7 +217,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,7 +271,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -291,7 +291,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,10 +402,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -429,7 +429,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,10 +481,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -507,7 +507,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -560,10 +560,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -591,7 +591,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +655,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -680,7 +680,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -736,7 +736,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -763,7 +763,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -818,7 +818,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -843,7 +843,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -894,10 +894,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -926,7 +926,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,10 +984,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1010,7 +1010,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py index 1d25910271644..d3278dc896e45 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobServiceProperties" + parameters, # type: "_models.BlobServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -70,7 +70,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -140,7 +140,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py index a0cb71a5defa9..25b09f78a2a72 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ManagementPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def get( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountManagementPolicies" + # type: (...) -> "_models.StorageAccountManagementPolicies" """Gets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def create_or_update( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] - properties, # type: "models.ManagementPoliciesRulesSetParameter" + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPoliciesRulesSetParameter" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountManagementPolicies" + # type: (...) -> "_models.StorageAccountManagementPolicies" """Sets the data policy rules associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -139,7 +139,7 @@ def create_or_update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountManagementPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountManagementPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def delete( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py index 9d1de40a0f0b7..934ea1a3c3096 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py index c7d8762406b24..6ec7114820dae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py index 27b50014948a2..6f7d7a0a48bed 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_07_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -300,7 +306,7 @@ def get_properties( expand="geoReplicationStats", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -320,7 +326,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,10 +373,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -394,7 +400,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -444,7 +450,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -453,7 +459,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +519,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -525,7 +531,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +593,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -602,7 +608,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,10 +653,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -667,7 +673,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,10 +723,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -737,7 +743,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,10 +793,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -807,7 +813,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -946,7 +952,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py index ac7fc3f94b4c1..f0811efef51dd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -61,7 +61,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_07_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_metadata.json index 9865ade341fbf..d23af77b68631 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py index cdfdbb9ccb113..2525e26d690d1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py @@ -68,7 +68,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/_storage_management_client.py index 8773f824c8867..3fe725d45cf79 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/_storage_management_client.py @@ -65,7 +65,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py index 00b0658572bc5..96960caf91655 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListContainerItems": + ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -61,7 +61,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -133,7 +133,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -189,9 +189,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -214,7 +214,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,7 +267,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -287,7 +287,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -397,9 +397,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -423,7 +423,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -475,9 +475,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -500,7 +500,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -553,9 +553,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -583,7 +583,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +646,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -671,7 +671,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -726,7 +726,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -753,7 +753,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +807,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -832,7 +832,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -883,9 +883,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -914,7 +914,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -972,9 +972,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -997,7 +997,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py index 405d68afc3ee7..6fddb5583f164 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BlobServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.BlobServiceProperties", + parameters: "_models.BlobServiceProperties", **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -65,7 +65,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -134,7 +134,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py index 37b1b0f5d99fb..e8038a30d8d3c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ManagementPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def get( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], - properties: "models.ManagementPolicy", + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPolicy", **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -133,7 +133,7 @@ async def create_or_update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def delete( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py index 2a7daaea05dfc..6c5ccf3719f33 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py index c8adcf587d979..56e3ff52482fe 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py index c6c704d6498b3..a5106a60ec593 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_11_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -291,7 +297,7 @@ async def get_properties( account_name: str, expand: Optional[str] = "geoReplicationStats", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -311,7 +317,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +364,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -384,7 +390,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,7 +439,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -442,7 +448,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +507,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -513,7 +519,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +580,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -589,7 +595,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -634,9 +640,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -653,7 +659,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,9 +709,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -722,7 +728,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -772,9 +778,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -791,7 +797,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -928,7 +934,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py index 0c47e8151e5ea..615ca2cde4c49 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -56,7 +56,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2018_11_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py index 903dd94b56479..75d4d39dce16e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py @@ -75,17 +75,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -112,17 +112,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -155,13 +155,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -251,13 +251,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -784,13 +784,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1098,13 +1098,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1238,13 +1238,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -1898,19 +1898,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -1949,13 +1949,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py index 7656bc05a9e4e..aec4410294b90 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py @@ -89,17 +89,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -126,17 +126,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -169,13 +169,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -268,13 +268,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -835,13 +835,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1172,13 +1172,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1317,13 +1317,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -2054,19 +2054,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -2108,13 +2108,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py index 64171f81ea3f1..acdf40ea1b463 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListContainerItems" + # type: (...) -> "_models.ListContainerItems" """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -66,7 +66,7 @@ def list( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListContainerItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -139,7 +139,7 @@ def create( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -195,10 +195,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -221,7 +221,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,7 +275,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -295,7 +295,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,10 +406,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -433,7 +433,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,10 +485,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -511,7 +511,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -564,10 +564,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -595,7 +595,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -659,7 +659,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -684,7 +684,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -740,7 +740,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -767,7 +767,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -822,7 +822,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -847,7 +847,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -898,10 +898,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -930,7 +930,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -988,10 +988,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1014,7 +1014,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py index 98c75191a267a..0b3fb50269781 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BlobServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobServiceProperties" + parameters, # type: "_models.BlobServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -70,7 +70,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -140,7 +140,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py index ddf2d2ba15a9f..4f68d5c362016 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ManagementPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def get( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def create_or_update( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] - properties, # type: "models.ManagementPolicy" + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -139,7 +139,7 @@ def create_or_update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def delete( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py index 057c6ef91d8a9..f175b84def049 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py index c95f83c8d5d2f..84cf8529abd89 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py index 9025191b0c1ee..dad6f8d9d84af 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2018_11_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -300,7 +306,7 @@ def get_properties( expand="geoReplicationStats", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -320,7 +326,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,10 +373,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -394,7 +400,7 @@ def update( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -444,7 +450,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -453,7 +459,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +519,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -525,7 +531,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +593,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -602,7 +608,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,10 +653,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -667,7 +673,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,10 +723,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -737,7 +743,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,10 +793,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -807,7 +813,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -946,7 +952,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py index 67cd4cff88f1d..cc7aa7866b9c3 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -61,7 +61,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2018_11_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_metadata.json index 2f98da97fb6ac..8554bb478da2d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py index 8bebd1568e412..5c1f8a75529c5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py @@ -74,7 +74,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/_storage_management_client.py index 7d0b34632205e..e44507fdb7d72 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/_storage_management_client.py @@ -71,7 +71,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py index 9741d00c3a5cc..61745a2f8da1c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ListContainerItems"]: + ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.ListContainerItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -141,9 +141,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -167,7 +167,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,9 +223,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -248,7 +248,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -321,7 +321,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,9 +431,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -457,7 +457,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -509,9 +509,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -534,7 +534,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,9 +587,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -617,7 +617,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -680,7 +680,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -705,7 +705,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -760,7 +760,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -787,7 +787,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,7 +841,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -866,7 +866,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -917,9 +917,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -948,7 +948,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1006,9 +1006,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1031,7 +1031,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py index d75df970ed324..d84629d049ab4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BlobServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.BlobServiceItems"]: + ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.BlobServiceItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,9 +122,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.BlobServiceProperties", + parameters: "_models.BlobServiceProperties", **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -143,7 +143,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -196,7 +196,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -212,7 +212,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py index 55a158645f8dc..699f805a87cf6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class FileServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.FileServiceItems": + ) -> "_models.FileServiceItems": """List all file services in storage accounts. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,9 +105,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.FileServiceProperties", + parameters: "_models.FileServiceProperties", **kwargs - ) -> "models.FileServiceProperties": + ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -126,7 +126,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.FileServiceProperties": + ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py index dbb331e5ee4c6..c1e5a0e3e956c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class FileSharesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.FileShareItems"]: + ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -72,7 +72,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.FileShareItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShareItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -140,9 +140,9 @@ async def create( resource_group_name: str, account_name: str, share_name: str, - file_share: "models.FileShare", + file_share: "_models.FileShare", **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. @@ -166,7 +166,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +222,9 @@ async def update( resource_group_name: str, account_name: str, share_name: str, - file_share: "models.FileShare", + file_share: "_models.FileShare", **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -247,7 +247,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ async def get( account_name: str, share_name: str, **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Gets properties of a specified share. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -320,7 +320,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py index 94839f9531d79..86109b1cc9882 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ManagementPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def get( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], - properties: "models.ManagementPolicy", + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPolicy", **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -133,7 +133,7 @@ async def create_or_update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def delete( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py index 0f4d4b982e5c9..f5f819cd8278e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py index 860108ffcbe48..c43bad98990cf 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py index 5f52450ab1409..a675798c1a395 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2019_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -291,7 +297,7 @@ async def get_properties( account_name: str, expand: Optional[str] = "geoReplicationStats", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -311,7 +317,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +364,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -384,7 +390,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,7 +439,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -442,7 +448,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +507,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -513,7 +519,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +581,7 @@ async def list_keys( account_name: str, expand: Optional[str] = "kerb", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -593,7 +599,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -640,9 +646,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -660,7 +666,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,9 +716,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -729,7 +735,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,9 +785,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -798,7 +804,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -935,7 +941,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py index 227ac563d3c46..58d6fe413f706 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -56,7 +56,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_04_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index d31d351239629..d1416717d20d9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -126,17 +126,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -163,17 +163,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -238,13 +238,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -359,13 +359,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -894,13 +894,13 @@ class FileServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -934,13 +934,13 @@ class FileShare(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -987,13 +987,13 @@ class FileShareItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1155,13 +1155,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1469,13 +1469,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1621,13 +1621,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -2282,19 +2282,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -2333,13 +2333,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 80b4fe150d9ef..2f14cbaa657e2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -147,17 +147,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -184,17 +184,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -262,13 +262,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -386,13 +386,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -964,13 +964,13 @@ class FileServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -1006,13 +1006,13 @@ class FileShare(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1062,13 +1062,13 @@ class FileShareItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1233,13 +1233,13 @@ class ImmutabilityPolicy(AzureEntityResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1570,13 +1570,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1725,13 +1725,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -2463,19 +2463,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -2517,13 +2517,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py index 3df2370d66d3a..6381aae09c1c7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListContainerItems"] + # type: (...) -> Iterable["_models.ListContainerItems"] """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.ListContainerItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -146,10 +146,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -173,7 +173,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +229,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -255,7 +255,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -329,7 +329,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -440,10 +440,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -467,7 +467,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +519,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -545,7 +545,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -598,10 +598,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -629,7 +629,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -693,7 +693,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -718,7 +718,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -774,7 +774,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the @@ -801,7 +801,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -856,7 +856,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -881,7 +881,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,10 +932,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -964,7 +964,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,10 +1022,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1048,7 +1048,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py index 180fb7a283c4c..9730e2efa8f71 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BlobServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BlobServiceItems"] + # type: (...) -> Iterable["_models.BlobServiceItems"] """List blob services of storage account. It returns a collection of one object named default. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -66,7 +66,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.BlobServiceItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,10 +127,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobServiceProperties" + parameters, # type: "_models.BlobServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -149,7 +149,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -203,7 +203,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -219,7 +219,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py index d5161d6832e2e..43c597476ca1c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class FileServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FileServiceItems" + # type: (...) -> "_models.FileServiceItems" """List all file services in storage accounts. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.FileServiceProperties" + parameters, # type: "_models.FileServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.FileServiceProperties" + # type: (...) -> "_models.FileServiceProperties" """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -132,7 +132,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,7 +186,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FileServiceProperties" + # type: (...) -> "_models.FileServiceProperties" """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -202,7 +202,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py index 839b04b542519..2cebba1bfb4d4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class FileSharesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.FileShareItems"] + # type: (...) -> Iterable["_models.FileShareItems"] """Lists all shares. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -77,7 +77,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.FileShareItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShareItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,10 +145,10 @@ def create( resource_group_name, # type: str account_name, # type: str share_name, # type: str - file_share, # type: "models.FileShare" + file_share, # type: "_models.FileShare" **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. @@ -172,7 +172,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +228,10 @@ def update( resource_group_name, # type: str account_name, # type: str share_name, # type: str - file_share, # type: "models.FileShare" + file_share, # type: "_models.FileShare" **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -254,7 +254,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -308,7 +308,7 @@ def get( share_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Gets properties of a specified share. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -328,7 +328,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py index ccb1c5c5d96a5..5a07d51951237 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ManagementPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def get( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def create_or_update( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] - properties, # type: "models.ManagementPolicy" + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -139,7 +139,7 @@ def create_or_update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def delete( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py index 778d1fe5ec319..2957ae6212fb1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py index 87cf0c29331c0..59390efad1633 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py index b5dd1795eab21..9ec0feb6c0557 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2019_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -300,7 +306,7 @@ def get_properties( expand="geoReplicationStats", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -320,7 +326,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,10 +373,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -394,7 +400,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -444,7 +450,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -453,7 +459,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +519,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -525,7 +531,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +594,7 @@ def list_keys( expand="kerb", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -606,7 +612,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -653,10 +659,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys or Kerberos keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -674,7 +680,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -724,10 +730,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -744,7 +750,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +800,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -814,7 +820,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +959,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py index e2ac55ad557c3..daffcc3e1e549 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -61,7 +61,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_04_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_metadata.json index a29be812e338a..ceb9cba93da2c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_metadata.json +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py index cb7d9fd2a62dd..fe6cfdddcf56d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py @@ -98,7 +98,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py index 520198a23bdd2..ea35340245a1e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py @@ -95,7 +95,6 @@ def __init__( 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.operations = Operations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py index 1980bfc861906..d9623852d7832 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BlobContainersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - include: Optional[Union[str, "models.ListContainersInclude"]] = None, + include: Optional[Union[str, "_models.ListContainersInclude"]] = None, **kwargs - ) -> AsyncIterable["models.ListContainerItems"]: + ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListContainerItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -141,9 +141,9 @@ async def create( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -167,7 +167,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,9 +223,9 @@ async def update( resource_group_name: str, account_name: str, container_name: str, - blob_container: "models.BlobContainer", + blob_container: "_models.BlobContainer", **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -248,7 +248,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ async def get( account_name: str, container_name: str, **kwargs - ) -> "models.BlobContainer": + ) -> "_models.BlobContainer": """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -321,7 +321,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,9 +431,9 @@ async def set_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -457,7 +457,7 @@ async def set_legal_hold( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -509,9 +509,9 @@ async def clear_legal_hold( resource_group_name: str, account_name: str, container_name: str, - legal_hold: "models.LegalHold", + legal_hold: "_models.LegalHold", **kwargs - ) -> "models.LegalHold": + ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -534,7 +534,7 @@ async def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,9 +587,9 @@ async def create_or_update_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -617,7 +617,7 @@ async def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -680,7 +680,7 @@ async def get_immutability_policy( container_name: str, if_match: Optional[str] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -705,7 +705,7 @@ async def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -760,7 +760,7 @@ async def delete_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the @@ -787,7 +787,7 @@ async def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,7 +841,7 @@ async def lock_immutability_policy( container_name: str, if_match: str, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -866,7 +866,7 @@ async def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -917,9 +917,9 @@ async def extend_immutability_policy( account_name: str, container_name: str, if_match: str, - parameters: Optional["models.ImmutabilityPolicy"] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, **kwargs - ) -> "models.ImmutabilityPolicy": + ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -948,7 +948,7 @@ async def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1006,9 +1006,9 @@ async def lease( resource_group_name: str, account_name: str, container_name: str, - parameters: Optional["models.LeaseContainerRequest"] = None, + parameters: Optional["_models.LeaseContainerRequest"] = None, **kwargs - ) -> "models.LeaseContainerResponse": + ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1031,7 +1031,7 @@ async def lease( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py index e46fb6c2324b3..77011429aac11 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BlobServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.BlobServiceItems"]: + ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.BlobServiceItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,9 +122,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.BlobServiceProperties", + parameters: "_models.BlobServiceProperties", **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -143,7 +143,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -196,7 +196,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.BlobServiceProperties": + ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -212,7 +212,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py index 00ef4ad06b1ee..06aa8765deeb6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EncryptionScopesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,9 +46,9 @@ async def put( resource_group_name: str, account_name: str, encryption_scope_name: str, - encryption_scope: "models.EncryptionScope", + encryption_scope: "_models.EncryptionScope", **kwargs - ) -> "models.EncryptionScope": + ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. @@ -72,7 +72,7 @@ async def put( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ async def put( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -129,9 +129,9 @@ async def patch( resource_group_name: str, account_name: str, encryption_scope_name: str, - encryption_scope: "models.EncryptionScope", + encryption_scope: "_models.EncryptionScope", **kwargs - ) -> "models.EncryptionScope": + ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -154,7 +154,7 @@ async def patch( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ async def patch( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EncryptionScope', pipeline_response) @@ -208,7 +208,7 @@ async def get( account_name: str, encryption_scope_name: str, **kwargs - ) -> "models.EncryptionScope": + ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -228,7 +228,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +260,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EncryptionScope', pipeline_response) @@ -276,7 +276,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.EncryptionScopeListResult"]: + ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -291,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py index 56d84b89ef7ce..a54bc3a7153a1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class FileServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.FileServiceItems": + ) -> "_models.FileServiceItems": """List all file services in storage accounts. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,9 +105,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.FileServiceProperties", + parameters: "_models.FileServiceProperties", **kwargs - ) -> "models.FileServiceProperties": + ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -126,7 +126,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.FileServiceProperties": + ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py index f251e063d5629..f73bba4db4a97 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class FileSharesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list( filter: Optional[str] = None, expand: Optional[str] = "deleted", **kwargs - ) -> AsyncIterable["models.FileShareItems"]: + ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -72,7 +72,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.FileShareItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShareItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -140,9 +140,9 @@ async def create( resource_group_name: str, account_name: str, share_name: str, - file_share: "models.FileShare", + file_share: "_models.FileShare", **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. @@ -166,7 +166,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +222,9 @@ async def update( resource_group_name: str, account_name: str, share_name: str, - file_share: "models.FileShare", + file_share: "_models.FileShare", **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -247,7 +247,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ async def get( share_name: str, expand: Optional[str] = "stats", **kwargs - ) -> "models.FileShare": + ) -> "_models.FileShare": """Gets properties of a specified share. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -323,7 +323,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -437,7 +437,7 @@ async def restore( resource_group_name: str, account_name: str, share_name: str, - deleted_share: "models.DeletedShare", + deleted_share: "_models.DeletedShare", **kwargs ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py index f49a48b1076f3..68bdaea9f8a82 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ManagementPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def get( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], - properties: "models.ManagementPolicy", + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPolicy", **kwargs - ) -> "models.ManagementPolicy": + ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -133,7 +133,7 @@ async def create_or_update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def delete( self, resource_group_name: str, account_name: str, - management_policy_name: Union[str, "models.ManagementPolicyName"], + management_policy_name: Union[str, "_models.ManagementPolicyName"], **kwargs ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py index ab79d1a660562..9c0fd4eeeec70 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ObjectReplicationPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.ObjectReplicationPolicies"]: + ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -125,7 +125,7 @@ async def get( account_name: str, object_replication_policy_id: str, **kwargs - ) -> "models.ObjectReplicationPolicy": + ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -143,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,7 +175,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) @@ -191,9 +191,9 @@ async def create_or_update( resource_group_name: str, account_name: str, object_replication_policy_id: str, - properties: "models.ObjectReplicationPolicy", + properties: "_models.ObjectReplicationPolicy", **kwargs - ) -> "models.ObjectReplicationPolicy": + ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -214,7 +214,7 @@ async def create_or_update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -251,7 +251,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) @@ -318,7 +318,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py index e092268795b03..415785e7ec768 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py index 4a156c1382f73..3d44a48e24c8e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PrivateEndpointConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ async def get( account_name: str, private_endpoint_connection_name: str, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -142,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -190,9 +190,9 @@ async def put( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - properties: "models.PrivateEndpointConnection", + properties: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -212,7 +212,7 @@ async def put( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,7 +249,7 @@ async def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -316,7 +316,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py index eea58733a86b9..eeff3d9fc1b45 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PrivateLinkResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list_by_storage_account( resource_group_name: str, account_name: str, **kwargs - ) -> "models.PrivateLinkResourceListResult": + ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -60,7 +60,7 @@ async def list_by_storage_account( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py index 525d1d41f92f4..99380a39dc618 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class QueueOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,9 +46,9 @@ async def create( resource_group_name: str, account_name: str, queue_name: str, - queue: "models.StorageQueue", + queue: "_models.StorageQueue", **kwargs - ) -> "models.StorageQueue": + ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -70,7 +70,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,9 +122,9 @@ async def update( resource_group_name: str, account_name: str, queue_name: str, - queue: "models.StorageQueue", + queue: "_models.StorageQueue", **kwargs - ) -> "models.StorageQueue": + ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -146,7 +146,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +199,7 @@ async def get( account_name: str, queue_name: str, **kwargs - ) -> "models.StorageQueue": + ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -219,7 +219,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -333,7 +333,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ListQueueResource"]: + ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -354,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListQueueResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListQueueResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py index 6bffda8106a84..66a73c4c5a3d8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class QueueServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListQueueServices": + ) -> "_models.ListQueueServices": """List all queue services for the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListQueueServices :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListQueueServices"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,9 +105,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.QueueServiceProperties", + parameters: "_models.QueueServiceProperties", **kwargs - ) -> "models.QueueServiceProperties": + ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -126,7 +126,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.QueueServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.QueueServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.QueueServiceProperties": + ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.QueueServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.QueueServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py index bb89ba9bc864e..bc035d05d4e04 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.StorageSkuListResult"]: + ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py index 8214f5a98f53e..76f12d1ba8024 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -59,7 +59,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.storage.v2019_06_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -190,7 +190,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -289,9 +295,9 @@ async def get_properties( self, resource_group_name: str, account_name: str, - expand: Optional[Union[str, "models.StorageAccountExpand"]] = None, + expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -312,7 +318,7 @@ async def get_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,9 +365,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -385,7 +391,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,7 +440,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -443,7 +449,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -502,7 +508,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -514,7 +520,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -576,7 +582,7 @@ async def list_keys( account_name: str, expand: Optional[str] = "kerb", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -594,7 +600,7 @@ async def list_keys( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -641,9 +647,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - regenerate_key: "models.StorageAccountRegenerateKeyParameters", + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", **kwargs - ) -> "models.StorageAccountListKeysResult": + ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -661,7 +667,7 @@ async def regenerate_key( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,9 +717,9 @@ async def list_account_sas( self, resource_group_name: str, account_name: str, - parameters: "models.AccountSasParameters", + parameters: "_models.AccountSasParameters", **kwargs - ) -> "models.ListAccountSasResponse": + ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -730,7 +736,7 @@ async def list_account_sas( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -780,9 +786,9 @@ async def list_service_sas( self, resource_group_name: str, account_name: str, - parameters: "models.ServiceSasParameters", + parameters: "_models.ServiceSasParameters", **kwargs - ) -> "models.ListServiceSasResponse": + ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -799,7 +805,7 @@ async def list_service_sas( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +942,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -954,10 +966,10 @@ async def _restore_blob_ranges_initial( self, resource_group_name: str, account_name: str, - parameters: "models.BlobRestoreParameters", + parameters: "_models.BlobRestoreParameters", **kwargs - ) -> "models.BlobRestoreStatus": - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobRestoreStatus"] + ) -> "_models.BlobRestoreStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1011,9 +1023,9 @@ async def begin_restore_blob_ranges( self, resource_group_name: str, account_name: str, - parameters: "models.BlobRestoreParameters", + parameters: "_models.BlobRestoreParameters", **kwargs - ) -> AsyncLROPoller["models.BlobRestoreStatus"]: + ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -1036,7 +1048,7 @@ async def begin_restore_blob_ranges( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobRestoreStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1061,7 +1073,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py index 05e8599310524..2686c9a573f44 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class TableOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def create( account_name: str, table_name: str, **kwargs - ) -> "models.Table": + ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -66,7 +66,7 @@ async def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ async def update( account_name: str, table_name: str, **kwargs - ) -> "models.Table": + ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -133,7 +133,7 @@ async def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ async def get( account_name: str, table_name: str, **kwargs - ) -> "models.Table": + ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -200,7 +200,7 @@ async def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +311,7 @@ def list( resource_group_name: str, account_name: str, **kwargs - ) -> AsyncIterable["models.ListTableResource"]: + ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -326,7 +326,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListTableResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListTableResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py index 148e3cad219f3..05bb2c8724ef2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class TableServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, account_name: str, **kwargs - ) -> "models.ListTableServices": + ) -> "_models.ListTableServices": """List all table services for the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListTableServices :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListTableServices"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,9 +105,9 @@ async def set_service_properties( self, resource_group_name: str, account_name: str, - parameters: "models.TableServiceProperties", + parameters: "_models.TableServiceProperties", **kwargs - ) -> "models.TableServiceProperties": + ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -126,7 +126,7 @@ async def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.TableServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ async def get_service_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.TableServiceProperties": + ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.TableServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py index e4fc4b51e60ea..160c428f72286 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.UsageListResult"]: + ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -56,7 +56,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py index d743b73695b44..36fd45813c5a6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py @@ -127,17 +127,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -164,17 +164,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -239,13 +239,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -493,13 +493,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku @@ -939,13 +939,13 @@ class EncryptionScope(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param source: The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", @@ -1232,13 +1232,13 @@ class FileServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku @@ -1282,13 +1282,13 @@ class FileShare(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1387,13 +1387,13 @@ class FileShareItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1605,13 +1605,13 @@ class ImmutabilityPolicy(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1950,13 +1950,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -2107,13 +2107,13 @@ class ListQueue(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param metadata: A name-value pair that represents queue metadata. :type metadata: dict[str, str] @@ -2280,13 +2280,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -2635,13 +2635,13 @@ class ObjectReplicationPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar policy_id: A unique id for object replication policy. :vartype policy_id: str @@ -2861,13 +2861,13 @@ class PrivateEndpointConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param private_endpoint: The resource of private end point. :type private_endpoint: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpoint @@ -2931,13 +2931,13 @@ class PrivateLinkResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar group_id: The private link resource group id. :vartype group_id: str @@ -3028,13 +3028,13 @@ class QueueServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -3426,19 +3426,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -3477,13 +3477,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -4111,13 +4111,13 @@ class StorageQueue(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param metadata: A name-value pair that represents queue metadata. :type metadata: dict[str, str] @@ -4181,13 +4181,13 @@ class Table(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar table_name: Table name under the specified account. :vartype table_name: str @@ -4220,13 +4220,13 @@ class TableServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py index cb4c84f4546c7..9cf495aae5c00 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py @@ -148,17 +148,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -185,17 +185,17 @@ def __init__( class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an etag. + """The resource model definition for an Azure Resource Manager resource with an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -263,13 +263,13 @@ class BlobContainer(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -528,13 +528,13 @@ class BlobServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku @@ -1019,13 +1019,13 @@ class EncryptionScope(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param source: The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", @@ -1332,13 +1332,13 @@ class FileServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku @@ -1385,13 +1385,13 @@ class FileShare(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1496,13 +1496,13 @@ class FileShareItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1720,13 +1720,13 @@ class ImmutabilityPolicy(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -2090,13 +2090,13 @@ class ListContainerItem(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -2252,13 +2252,13 @@ class ListQueue(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param metadata: A name-value pair that represents queue metadata. :type metadata: dict[str, str] @@ -2427,13 +2427,13 @@ class ManagementPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime @@ -2824,13 +2824,13 @@ class ObjectReplicationPolicy(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar policy_id: A unique id for object replication policy. :vartype policy_id: str @@ -3074,13 +3074,13 @@ class PrivateEndpointConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param private_endpoint: The resource of private end point. :type private_endpoint: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpoint @@ -3149,13 +3149,13 @@ class PrivateLinkResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar group_id: The private link resource group id. :vartype group_id: str @@ -3254,13 +3254,13 @@ class QueueServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS @@ -3689,19 +3689,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -3743,13 +3743,13 @@ class StorageAccount(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -4424,13 +4424,13 @@ class StorageQueue(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param metadata: A name-value pair that represents queue metadata. :type metadata: dict[str, str] @@ -4496,13 +4496,13 @@ class Table(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :ivar table_name: Table name under the specified account. :vartype table_name: str @@ -4535,13 +4535,13 @@ class TableServiceProperties(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or - Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py index e255d104ec1ad..bf96a0efe1232 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BlobContainersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def list( account_name, # type: str maxpagesize=None, # type: Optional[str] filter=None, # type: Optional[str] - include=None, # type: Optional[Union[str, "models.ListContainersInclude"]] + include=None, # type: Optional[Union[str, "_models.ListContainersInclude"]] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListContainerItems"] + # type: (...) -> Iterable["_models.ListContainerItems"] """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListContainerItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainerItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -146,10 +146,10 @@ def create( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @@ -173,7 +173,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +229,10 @@ def update( resource_group_name, # type: str account_name, # type: str container_name, # type: str - blob_container, # type: "models.BlobContainer" + blob_container, # type: "_models.BlobContainer" **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -255,7 +255,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get( container_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobContainer" + # type: (...) -> "_models.BlobContainer" """Gets properties of a specified container. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -329,7 +329,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobContainer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -440,10 +440,10 @@ def set_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. @@ -467,7 +467,7 @@ def set_legal_hold( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +519,10 @@ def clear_legal_hold( resource_group_name, # type: str account_name, # type: str container_name, # type: str - legal_hold, # type: "models.LegalHold" + legal_hold, # type: "_models.LegalHold" **kwargs # type: Any ): - # type: (...) -> "models.LegalHold" + # type: (...) -> "_models.LegalHold" """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -545,7 +545,7 @@ def clear_legal_hold( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LegalHold"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -598,10 +598,10 @@ def create_or_update_immutability_policy( account_name, # type: str container_name, # type: str if_match=None, # type: Optional[str] - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -629,7 +629,7 @@ def create_or_update_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -693,7 +693,7 @@ def get_immutability_policy( if_match=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -718,7 +718,7 @@ def get_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -774,7 +774,7 @@ def delete_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the @@ -801,7 +801,7 @@ def delete_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -856,7 +856,7 @@ def lock_immutability_policy( if_match, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -881,7 +881,7 @@ def lock_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,10 +932,10 @@ def extend_immutability_policy( account_name, # type: str container_name, # type: str if_match, # type: str - parameters=None, # type: Optional["models.ImmutabilityPolicy"] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] **kwargs # type: Any ): - # type: (...) -> "models.ImmutabilityPolicy" + # type: (...) -> "_models.ImmutabilityPolicy" """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -964,7 +964,7 @@ def extend_immutability_policy( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImmutabilityPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,10 +1022,10 @@ def lease( resource_group_name, # type: str account_name, # type: str container_name, # type: str - parameters=None, # type: Optional["models.LeaseContainerRequest"] + parameters=None, # type: Optional["_models.LeaseContainerRequest"] **kwargs # type: Any ): - # type: (...) -> "models.LeaseContainerResponse" + # type: (...) -> "_models.LeaseContainerResponse" """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1048,7 +1048,7 @@ def lease( :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LeaseContainerResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py index eac083659cc84..ae7dac24a49b4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BlobServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BlobServiceItems"] + # type: (...) -> Iterable["_models.BlobServiceItems"] """List blob services of storage account. It returns a collection of one object named default. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -66,7 +66,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.BlobServiceItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,10 +127,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobServiceProperties" + parameters, # type: "_models.BlobServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -149,7 +149,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -203,7 +203,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BlobServiceProperties" + # type: (...) -> "_models.BlobServiceProperties" """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -219,7 +219,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py index 03fb8254fd792..68ffe946a5529 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EncryptionScopesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,10 +50,10 @@ def put( resource_group_name, # type: str account_name, # type: str encryption_scope_name, # type: str - encryption_scope, # type: "models.EncryptionScope" + encryption_scope, # type: "_models.EncryptionScope" **kwargs # type: Any ): - # type: (...) -> "models.EncryptionScope" + # type: (...) -> "_models.EncryptionScope" """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified request. @@ -77,7 +77,7 @@ def put( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def put( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -134,10 +134,10 @@ def patch( resource_group_name, # type: str account_name, # type: str encryption_scope_name, # type: str - encryption_scope, # type: "models.EncryptionScope" + encryption_scope, # type: "_models.EncryptionScope" **kwargs # type: Any ): - # type: (...) -> "models.EncryptionScope" + # type: (...) -> "_models.EncryptionScope" """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -160,7 +160,7 @@ def patch( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ def patch( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EncryptionScope', pipeline_response) @@ -215,7 +215,7 @@ def get( encryption_scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EncryptionScope" + # type: (...) -> "_models.EncryptionScope" """Returns the properties for the specified encryption scope. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -235,7 +235,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,7 +267,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EncryptionScope', pipeline_response) @@ -284,7 +284,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EncryptionScopeListResult"] + # type: (...) -> Iterable["_models.EncryptionScopeListResult"] """Lists all the encryption scopes available under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -299,7 +299,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EncryptionScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py index 661f69fbaddb1..6b91fe812906c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class FileServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FileServiceItems" + # type: (...) -> "_models.FileServiceItems" """List all file services in storage accounts. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceItems :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.FileServiceProperties" + parameters, # type: "_models.FileServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.FileServiceProperties" + # type: (...) -> "_models.FileServiceProperties" """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -132,7 +132,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,7 +186,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FileServiceProperties" + # type: (...) -> "_models.FileServiceProperties" """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -202,7 +202,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py index 62da76fe52f5a..fb99c08b3cd7a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class FileSharesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list( expand="deleted", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.FileShareItems"] + # type: (...) -> Iterable["_models.FileShareItems"] """Lists all shares. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -77,7 +77,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.FileShareItems] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShareItems"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,10 +145,10 @@ def create( resource_group_name, # type: str account_name, # type: str share_name, # type: str - file_share, # type: "models.FileShare" + file_share, # type: "_models.FileShare" **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. @@ -172,7 +172,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +228,10 @@ def update( resource_group_name, # type: str account_name, # type: str share_name, # type: str - file_share, # type: "models.FileShare" + file_share, # type: "_models.FileShare" **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -254,7 +254,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get( expand="stats", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FileShare" + # type: (...) -> "_models.FileShare" """Gets properties of a specified share. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -331,7 +331,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FileShare"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +446,7 @@ def restore( resource_group_name, # type: str account_name, # type: str share_name, # type: str - deleted_share, # type: "models.DeletedShare" + deleted_share, # type: "_models.DeletedShare" **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py index bad35bd907155..c019d22617b1f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ManagementPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def get( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Gets the managementpolicy associated with the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def create_or_update( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] - properties, # type: "models.ManagementPolicy" + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ManagementPolicy" + # type: (...) -> "_models.ManagementPolicy" """Sets the managementpolicy to the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -139,7 +139,7 @@ def create_or_update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def delete( self, resource_group_name, # type: str account_name, # type: str - management_policy_name, # type: Union[str, "models.ManagementPolicyName"] + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] **kwargs # type: Any ): # type: (...) -> None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py index 2c5c7be4d7897..bf776273ffc21 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ObjectReplicationPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ObjectReplicationPolicies"] + # type: (...) -> Iterable["_models.ObjectReplicationPolicies"] """List the object replication policies associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -66,7 +66,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -131,7 +131,7 @@ def get( object_replication_policy_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ObjectReplicationPolicy" + # type: (...) -> "_models.ObjectReplicationPolicy" """Get the object replication policy of the storage account by policy ID. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -149,7 +149,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) @@ -197,10 +197,10 @@ def create_or_update( resource_group_name, # type: str account_name, # type: str object_replication_policy_id, # type: str - properties, # type: "models.ObjectReplicationPolicy" + properties, # type: "_models.ObjectReplicationPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ObjectReplicationPolicy" + # type: (...) -> "_models.ObjectReplicationPolicy" """Create or update the object replication policy of the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -221,7 +221,7 @@ def create_or_update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectReplicationPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -258,7 +258,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) @@ -326,7 +326,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_operations.py index 7aff7131ca1da..a96d3bf80d89b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Storage Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py index a9ebc63dd73f7..10647439fe8b4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PrivateEndpointConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """List all the private endpoint connections associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -66,7 +66,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -130,7 +130,7 @@ def get( private_endpoint_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Gets the specified private endpoint connection associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -148,7 +148,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -196,10 +196,10 @@ def put( resource_group_name, # type: str account_name, # type: str private_endpoint_connection_name, # type: str - properties, # type: "models.PrivateEndpointConnection" + properties, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Update the state of specified private endpoint connection associated with the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -219,7 +219,7 @@ def put( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,7 +256,7 @@ def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -324,7 +324,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py index 4792ac6500bf1..d4be55ed6eb04 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PrivateLinkResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_storage_account( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkResourceListResult" + # type: (...) -> "_models.PrivateLinkResourceListResult" """Gets the private link resources that need to be created for a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -65,7 +65,7 @@ def list_by_storage_account( :rtype: ~azure.mgmt.storage.v2019_06_01.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py index af488d4d3204b..5e94df2292b96 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class QueueOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,10 +50,10 @@ def create( resource_group_name, # type: str account_name, # type: str queue_name, # type: str - queue, # type: "models.StorageQueue" + queue, # type: "_models.StorageQueue" **kwargs # type: Any ): - # type: (...) -> "models.StorageQueue" + # type: (...) -> "_models.StorageQueue" """Creates a new queue with the specified queue name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -75,7 +75,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,10 +127,10 @@ def update( resource_group_name, # type: str account_name, # type: str queue_name, # type: str - queue, # type: "models.StorageQueue" + queue, # type: "_models.StorageQueue" **kwargs # type: Any ): - # type: (...) -> "models.StorageQueue" + # type: (...) -> "_models.StorageQueue" """Creates a new queue with the specified queue name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -152,7 +152,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +206,7 @@ def get( queue_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageQueue" + # type: (...) -> "_models.StorageQueue" """Gets the queue with the specified queue name, under the specified account if it exists. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -226,7 +226,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageQueue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -342,7 +342,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListQueueResource"] + # type: (...) -> Iterable["_models.ListQueueResource"] """Gets a list of all the queues under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -363,7 +363,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListQueueResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListQueueResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py index 0ca2872002981..aca0ae0edcfbb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class QueueServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListQueueServices" + # type: (...) -> "_models.ListQueueServices" """List all queue services for the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListQueueServices :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListQueueServices"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.QueueServiceProperties" + parameters, # type: "_models.QueueServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.QueueServiceProperties" + # type: (...) -> "_models.QueueServiceProperties" """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -132,7 +132,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.QueueServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.QueueServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,7 +186,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.QueueServiceProperties" + # type: (...) -> "_models.QueueServiceProperties" """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -202,7 +202,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.QueueServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.QueueServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py index 56c0cd046fe0f..7f5287836659b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageSkuListResult"] + # type: (...) -> Iterable["_models.StorageSkuListResult"] """Lists the available SKUs supported by Microsoft.Storage for given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py index b0c2402242d94..79e55e29fa98a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that the storage account name is valid and is not already in use. :param account_name: The name of the storage account within the specified resource group. @@ -64,7 +64,7 @@ def check_name_availability( :rtype: ~azure.mgmt.storage.v2019_06_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,11 +112,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or @@ -197,7 +197,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -297,10 +303,10 @@ def get_properties( self, resource_group_name, # type: str account_name, # type: str - expand=None, # type: Optional[Union[str, "models.StorageAccountExpand"]] + expand=None, # type: Optional[Union[str, "_models.StorageAccountExpand"]] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -321,7 +327,7 @@ def get_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,10 +374,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not @@ -395,7 +401,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +451,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -454,7 +460,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +520,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -526,7 +532,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +595,7 @@ def list_keys( expand="kerb", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -607,7 +613,7 @@ def list_keys( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,10 +660,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - regenerate_key, # type: "models.StorageAccountRegenerateKeyParameters" + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountListKeysResult" + # type: (...) -> "_models.StorageAccountListKeysResult" """Regenerates one of the access keys or Kerberos keys for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -675,7 +681,7 @@ def regenerate_key( :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListKeysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,10 +731,10 @@ def list_account_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.AccountSasParameters" + parameters, # type: "_models.AccountSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListAccountSasResponse" + # type: (...) -> "_models.ListAccountSasResponse" """List SAS credentials of a storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -745,7 +751,7 @@ def list_account_sas( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListAccountSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListAccountSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -795,10 +801,10 @@ def list_service_sas( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.ServiceSasParameters" + parameters, # type: "_models.ServiceSasParameters" **kwargs # type: Any ): - # type: (...) -> "models.ListServiceSasResponse" + # type: (...) -> "_models.ListServiceSasResponse" """List service SAS credentials of a specific resource. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -815,7 +821,7 @@ def list_service_sas( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListServiceSasResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListServiceSasResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +960,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -972,11 +984,11 @@ def _restore_blob_ranges_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobRestoreParameters" + parameters, # type: "_models.BlobRestoreParameters" **kwargs # type: Any ): - # type: (...) -> "models.BlobRestoreStatus" - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobRestoreStatus"] + # type: (...) -> "_models.BlobRestoreStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1030,10 +1042,10 @@ def begin_restore_blob_ranges( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.BlobRestoreParameters" + parameters, # type: "_models.BlobRestoreParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BlobRestoreStatus"] + # type: (...) -> LROPoller["_models.BlobRestoreStatus"] """Restore blobs in the specified blob ranges. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -1056,7 +1068,7 @@ def begin_restore_blob_ranges( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BlobRestoreStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1081,7 +1093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_operations.py index 431f3c440132e..64d9bbe2fc015 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class TableOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def create( table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Table" + # type: (...) -> "_models.Table" """Creates a new table with the specified table name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -71,7 +71,7 @@ def create( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def update( table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Table" + # type: (...) -> "_models.Table" """Creates a new table with the specified table name, under the specified account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -139,7 +139,7 @@ def update( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -188,7 +188,7 @@ def get( table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Table" + # type: (...) -> "_models.Table" """Gets the table with the specified table name, under the specified account if it exists. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -207,7 +207,7 @@ def get( :rtype: ~azure.mgmt.storage.v2019_06_01.models.Table :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Table"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +320,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListTableResource"] + # type: (...) -> Iterable["_models.ListTableResource"] """Gets a list of all the tables under the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -335,7 +335,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListTableResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListTableResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py index 2f3bc9f76d55e..f76a31b992c49 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class TableServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ListTableServices" + # type: (...) -> "_models.ListTableServices" """List all table services for the storage account. :param resource_group_name: The name of the resource group within the user's subscription. The @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListTableServices :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListTableServices"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ def set_service_properties( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.TableServiceProperties" + parameters, # type: "_models.TableServiceProperties" **kwargs # type: Any ): - # type: (...) -> "models.TableServiceProperties" + # type: (...) -> "_models.TableServiceProperties" """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -132,7 +132,7 @@ def set_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.TableServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,7 +186,7 @@ def get_service_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.TableServiceProperties" + # type: (...) -> "_models.TableServiceProperties" """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -202,7 +202,7 @@ def get_service_properties( :rtype: ~azure.mgmt.storage.v2019_06_01.models.TableServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py index 1f909d4d09afd..6e6699a9122dd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageListResult"] + # type: (...) -> Iterable["_models.UsageListResult"] """Gets the current usage count and the limit for the resources of the location under the subscription. @@ -61,7 +61,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.UsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py new file mode 100644 index 0000000000000..75a361344ca26 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py new file mode 100644 index 0000000000000..7c33f9ab4f223 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class StorageManagementClientConfiguration(Configuration): + """Configuration for StorageManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-08-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_metadata.json new file mode 100644 index 0000000000000..c825f30345850 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_metadata.json @@ -0,0 +1,79 @@ +{ + "chosen_version": "2020-08-01-preview", + "total_api_version_list": ["2020-08-01-preview"], + "client": { + "name": "StorageManagementClient", + "filename": "_storage_management_client", + "description": "The Azure Storage Management API.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "skus": "SkusOperations", + "storage_accounts": "StorageAccountsOperations", + "deleted_accounts": "DeletedAccountsOperations", + "usages": "UsagesOperations", + "management_policies": "ManagementPoliciesOperations", + "blob_inventory_policies": "BlobInventoryPoliciesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "object_replication_policies": "ObjectReplicationPoliciesOperations", + "encryption_scopes": "EncryptionScopesOperations", + "blob_services": "BlobServicesOperations", + "blob_containers": "BlobContainersOperations", + "file_services": "FileServicesOperations", + "file_shares": "FileSharesOperations", + "queue_services": "QueueServicesOperations", + "queue": "QueueOperations", + "table_services": "TableServicesOperations", + "table": "TableOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py new file mode 100644 index 0000000000000..d052cc984d368 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import DeletedAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobInventoryPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import EncryptionScopesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from .operations import QueueServicesOperations +from .operations import QueueOperations +from .operations import TableServicesOperations +from .operations import TableOperations +from . import models + + +class StorageManagementClient(object): + """The Azure Storage Management API. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2020_08_01_preview.operations.Operations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.storage.v2020_08_01_preview.operations.SkusOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.storage.v2020_08_01_preview.operations.StorageAccountsOperations + :ivar deleted_accounts: DeletedAccountsOperations operations + :vartype deleted_accounts: azure.mgmt.storage.v2020_08_01_preview.operations.DeletedAccountsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.storage.v2020_08_01_preview.operations.UsagesOperations + :ivar management_policies: ManagementPoliciesOperations operations + :vartype management_policies: azure.mgmt.storage.v2020_08_01_preview.operations.ManagementPoliciesOperations + :ivar blob_inventory_policies: BlobInventoryPoliciesOperations operations + :vartype blob_inventory_policies: azure.mgmt.storage.v2020_08_01_preview.operations.BlobInventoryPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2020_08_01_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.storage.v2020_08_01_preview.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPoliciesOperations operations + :vartype object_replication_policies: azure.mgmt.storage.v2020_08_01_preview.operations.ObjectReplicationPoliciesOperations + :ivar encryption_scopes: EncryptionScopesOperations operations + :vartype encryption_scopes: azure.mgmt.storage.v2020_08_01_preview.operations.EncryptionScopesOperations + :ivar blob_services: BlobServicesOperations operations + :vartype blob_services: azure.mgmt.storage.v2020_08_01_preview.operations.BlobServicesOperations + :ivar blob_containers: BlobContainersOperations operations + :vartype blob_containers: azure.mgmt.storage.v2020_08_01_preview.operations.BlobContainersOperations + :ivar file_services: FileServicesOperations operations + :vartype file_services: azure.mgmt.storage.v2020_08_01_preview.operations.FileServicesOperations + :ivar file_shares: FileSharesOperations operations + :vartype file_shares: azure.mgmt.storage.v2020_08_01_preview.operations.FileSharesOperations + :ivar queue_services: QueueServicesOperations operations + :vartype queue_services: azure.mgmt.storage.v2020_08_01_preview.operations.QueueServicesOperations + :ivar queue: QueueOperations operations + :vartype queue: azure.mgmt.storage.v2020_08_01_preview.operations.QueueOperations + :ivar table_services: TableServicesOperations operations + :vartype table_services: azure.mgmt.storage.v2020_08_01_preview.operations.TableServicesOperations + :ivar table: TableOperations operations + :vartype table: azure.mgmt.storage.v2020_08_01_preview.operations.TableOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # 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 = StorageManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_accounts = DeletedAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_inventory_policies = BlobInventoryPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue_services = QueueServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table_services = TableServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table = TableOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> StorageManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/__init__.py new file mode 100644 index 0000000000000..9cfe0ace1ba97 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient'] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_configuration.py new file mode 100644 index 0000000000000..8158795c28c84 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class StorageManagementClientConfiguration(Configuration): + """Configuration for StorageManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-08-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_storage_management_client.py new file mode 100644 index 0000000000000..2f5806172e2fe --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/_storage_management_client.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import DeletedAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobInventoryPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import EncryptionScopesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from .operations import QueueServicesOperations +from .operations import QueueOperations +from .operations import TableServicesOperations +from .operations import TableOperations +from .. import models + + +class StorageManagementClient(object): + """The Azure Storage Management API. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2020_08_01_preview.aio.operations.Operations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.storage.v2020_08_01_preview.aio.operations.SkusOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.storage.v2020_08_01_preview.aio.operations.StorageAccountsOperations + :ivar deleted_accounts: DeletedAccountsOperations operations + :vartype deleted_accounts: azure.mgmt.storage.v2020_08_01_preview.aio.operations.DeletedAccountsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.storage.v2020_08_01_preview.aio.operations.UsagesOperations + :ivar management_policies: ManagementPoliciesOperations operations + :vartype management_policies: azure.mgmt.storage.v2020_08_01_preview.aio.operations.ManagementPoliciesOperations + :ivar blob_inventory_policies: BlobInventoryPoliciesOperations operations + :vartype blob_inventory_policies: azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobInventoryPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2020_08_01_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.storage.v2020_08_01_preview.aio.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPoliciesOperations operations + :vartype object_replication_policies: azure.mgmt.storage.v2020_08_01_preview.aio.operations.ObjectReplicationPoliciesOperations + :ivar encryption_scopes: EncryptionScopesOperations operations + :vartype encryption_scopes: azure.mgmt.storage.v2020_08_01_preview.aio.operations.EncryptionScopesOperations + :ivar blob_services: BlobServicesOperations operations + :vartype blob_services: azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobServicesOperations + :ivar blob_containers: BlobContainersOperations operations + :vartype blob_containers: azure.mgmt.storage.v2020_08_01_preview.aio.operations.BlobContainersOperations + :ivar file_services: FileServicesOperations operations + :vartype file_services: azure.mgmt.storage.v2020_08_01_preview.aio.operations.FileServicesOperations + :ivar file_shares: FileSharesOperations operations + :vartype file_shares: azure.mgmt.storage.v2020_08_01_preview.aio.operations.FileSharesOperations + :ivar queue_services: QueueServicesOperations operations + :vartype queue_services: azure.mgmt.storage.v2020_08_01_preview.aio.operations.QueueServicesOperations + :ivar queue: QueueOperations operations + :vartype queue: azure.mgmt.storage.v2020_08_01_preview.aio.operations.QueueOperations + :ivar table_services: TableServicesOperations operations + :vartype table_services: azure.mgmt.storage.v2020_08_01_preview.aio.operations.TableServicesOperations + :ivar table: TableOperations operations + :vartype table: azure.mgmt.storage.v2020_08_01_preview.aio.operations.TableOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = StorageManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_accounts = DeletedAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_inventory_policies = BlobInventoryPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue_services = QueueServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table_services = TableServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table = TableOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "StorageManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/__init__.py new file mode 100644 index 0000000000000..bddcf8c8cb348 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_inventory_policies_operations import BlobInventoryPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations +from ._queue_services_operations import QueueServicesOperations +from ._queue_operations import QueueOperations +from ._table_services_operations import TableServicesOperations +from ._table_operations import TableOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'DeletedAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'BlobInventoryPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', + 'QueueServicesOperations', + 'QueueOperations', + 'TableServicesOperations', + 'TableOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py new file mode 100644 index 0000000000000..6bee05626118d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py @@ -0,0 +1,1082 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobContainersOperations: + """BlobContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + include: Optional[Union[str, "_models.ListContainersInclude"]] = None, + **kwargs + ) -> AsyncIterable["_models.ListContainerItems"]: + """Lists all containers and does not support a prefix like data plane. Also SRP today does not + return continuation token. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of containers that can be included in + the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting with the filter will be + listed. + :type filter: str + :param include: Optional, used to include the properties for soft deleted blob containers. + :type include: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ListContainersInclude + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListContainerItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListContainerItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + container_name: str, + blob_container: "_models.BlobContainer", + **kwargs + ) -> "_models.BlobContainer": + """Creates a new container under the specified account as described by request body. The container + resource includes metadata and properties for that container. It does not include a list of the + blobs contained by the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties of the blob container to create. + :type blob_container: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + container_name: str, + blob_container: "_models.BlobContainer", + **kwargs + ) -> "_models.BlobContainer": + """Updates container properties as specified in request body. Properties not mentioned in the + request will be unchanged. Update fails if the specified container doesn't already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties to update for the blob container. + :type blob_container: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs + ) -> "_models.BlobContainer": + """Gets properties of a specified container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs + ) -> None: + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def set_legal_hold( + self, + resource_group_name: str, + account_name: str, + container_name: str, + legal_hold: "_models.LegalHold", + **kwargs + ) -> "_models.LegalHold": + """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold + follows an append pattern and does not clear out the existing tags that are not specified in + the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be set to a blob container. + :type legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} # type: ignore + + async def clear_legal_hold( + self, + resource_group_name: str, + account_name: str, + container_name: str, + legal_hold: "_models.LegalHold", + **kwargs + ) -> "_models.LegalHold": + """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent + operation. ClearLegalHold clears out only the specified tags in the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be clear from a blob container. + :type legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.clear_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} # type: ignore + + async def create_or_update_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: Optional[str] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, + **kwargs + ) -> "_models.ImmutabilityPolicy": + """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but + not required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob + container. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def get_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: Optional[str] = None, + **kwargs + ) -> "_models.ImmutabilityPolicy": + """Gets the existing immutability policy along with the corresponding ETag in response headers and + body. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def delete_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + **kwargs + ) -> "_models.ImmutabilityPolicy": + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this + operation. Deleting a locked immutability policy is not allowed, the only way is to delete the + container after deleting all expired blobs inside the policy locked container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def lock_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + **kwargs + ) -> "_models.ImmutabilityPolicy": + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.lock_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(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) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} # type: ignore + + async def extend_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + parameters: Optional["_models.ImmutabilityPolicy"] = None, + **kwargs + ) -> "_models.ImmutabilityPolicy": + """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only + action allowed on a Locked policy will be this action. ETag in If-Match is required for this + operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob + container. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} # type: ignore + + async def lease( + self, + resource_group_name: str, + account_name: str, + container_name: str, + parameters: Optional["_models.LeaseContainerRequest"] = None, + **kwargs + ) -> "_models.LeaseContainerResponse": + """The Lease Container operation establishes and manages a lock on a container for delete + operations. The lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseContainerResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LeaseContainerResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py new file mode 100644 index 0000000000000..cb9f93bfefc34 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py @@ -0,0 +1,326 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobInventoryPoliciesOperations: + """BlobInventoryPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + **kwargs + ) -> "_models.BlobInventoryPolicy": + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + properties: "_models.BlobInventoryPolicy", + **kwargs + ) -> "_models.BlobInventoryPolicy": + """Sets the blob inventory policy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :param properties: The blob inventory policy set to a storage account. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # 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(properties, 'BlobInventoryPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + **kwargs + ) -> None: + """Deletes the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListBlobInventoryPolicy or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListBlobInventoryPolicy] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListBlobInventoryPolicy', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py new file mode 100644 index 0000000000000..d9505365c31ad --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py @@ -0,0 +1,256 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobServicesOperations: + """BlobServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.BlobServiceItems"]: + """List blob services of storage account. It returns a collection of one object named default. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BlobServiceItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BlobServiceItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobServiceProperties", + **kwargs + ) -> "_models.BlobServiceProperties": + """Sets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, including properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + blob_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_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') + + # 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(parameters, 'BlobServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.BlobServiceProperties": + """Gets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + blob_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py new file mode 100644 index 0000000000000..f3de147e1e0c5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeletedAccountsOperations: + """DeletedAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DeletedAccountListResult"]: + """Lists deleted accounts under the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'} # type: ignore + + async def get( + self, + deleted_account_name: str, + location: str, + **kwargs + ) -> "_models.DeletedAccount": + """Get properties of specified deleted account resource. + + :param deleted_account_name: Name of the deleted storage account. + :type deleted_account_name: str + :param location: The location of the deleted storage account. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedAccountName': self._serialize.url("deleted_account_name", deleted_account_name, 'str', max_length=24, min_length=3), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py new file mode 100644 index 0000000000000..000d991e04f12 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py @@ -0,0 +1,349 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EncryptionScopesOperations: + """EncryptionScopesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def put( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: "_models.EncryptionScope", + **kwargs + ) -> "_models.EncryptionScope": + """Synchronously creates or updates an encryption scope under the specified storage account. If an + encryption scope is already created and a subsequent request is issued with different + properties, the encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the create or update. + :type encryption_scope: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + 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(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + async def patch( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: "_models.EncryptionScope", + **kwargs + ) -> "_models.EncryptionScope": + """Update encryption scope properties as specified in the request body. Update fails if the + specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the update. + :type encryption_scope: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + 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(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + **kwargs + ) -> "_models.EncryptionScope": + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.EncryptionScopeListResult"]: + """Lists all the encryption scopes available under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EncryptionScopeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EncryptionScopeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py new file mode 100644 index 0000000000000..2fb3134f7aecb --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py @@ -0,0 +1,239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FileServicesOperations: + """FileServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.FileServiceItems": + """List all file services in storage accounts. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceItems, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceItems + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('FileServiceItems', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.FileServiceProperties", + **kwargs + ) -> "_models.FileServiceProperties": + """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of file services in storage accounts, including CORS (Cross- + Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + file_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_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') + + # 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(parameters, 'FileServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.FileServiceProperties": + """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + file_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py new file mode 100644 index 0000000000000..42790aa149e55 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py @@ -0,0 +1,521 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FileSharesOperations: + """FileSharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + expand: Optional[Union[str, "_models.ListSharesExpand"]] = None, + **kwargs + ) -> AsyncIterable["_models.FileShareItems"]: + """Lists all shares. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of shares that can be included in the + list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting with the filter will be + listed. + :type filter: str + :param expand: Optional, used to expand the properties within share's properties. + :type expand: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ListSharesExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FileShareItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FileShareItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + file_share: "_models.FileShare", + expand: Optional[str] = "snapshots", + **kwargs + ) -> "_models.FileShare": + """Creates a new share under the specified account as described by request body. The share + resource includes metadata and properties for that share. It does not include a list of the + files contained by the share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties of the file share to create. + :type file_share: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :param expand: Optional, used to create a snapshot. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FileShare', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + share_name: str, + file_share: "_models.FileShare", + **kwargs + ) -> "_models.FileShare": + """Updates share properties as specified in request body. Properties not mentioned in the request + will not be changed. Update fails if the specified share does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties to update for the file share. + :type file_share: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + expand: Optional[str] = "stats", + x_ms_snapshot: Optional[str] = None, + **kwargs + ) -> "_models.FileShare": + """Gets properties of a specified share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param expand: Optional, used to expand the properties within share's properties. + :type expand: str + :param x_ms_snapshot: Optional, used to retrieve properties of a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + x_ms_snapshot: Optional[str] = None, + **kwargs + ) -> None: + """Deletes specified share under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional, used to delete a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def restore( + self, + resource_group_name: str, + account_name: str, + share_name: str, + deleted_share: "_models.DeletedShare", + **kwargs + ) -> None: + """Restore a file share within a valid retention days if share soft delete is enabled. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param deleted_share: + :type deleted_share: ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.restore.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(deleted_share, 'DeletedShare') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py new file mode 100644 index 0000000000000..41fc144edfc1f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagementPoliciesOperations: + """ManagementPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + **kwargs + ) -> "_models.ManagementPolicy": + """Gets the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPolicy", + **kwargs + ) -> "_models.ManagementPolicy": + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :param properties: The ManagementPolicy set to a storage account. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # 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(properties, 'ManagementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + **kwargs + ) -> None: + """Deletes the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py new file mode 100644 index 0000000000000..8ff5a29926e07 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py @@ -0,0 +1,327 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ObjectReplicationPoliciesOperations: + """ObjectReplicationPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: + """List the object replication policies associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ObjectReplicationPolicies or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ObjectReplicationPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + **kwargs + ) -> "_models.ObjectReplicationPolicy": + """Get the object replication policy of the storage account by policy ID. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + properties: "_models.ObjectReplicationPolicy", + **kwargs + ) -> "_models.ObjectReplicationPolicy": + """Create or update the object replication policy of the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage account. A unique policy ID + will be created if absent. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + 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(properties, 'ObjectReplicationPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + **kwargs + ) -> None: + """Deletes the object replication policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py new file mode 100644 index 0000000000000..2dc76eec21b88 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +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. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available Storage Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..2ea586276dd37 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,325 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """List all the private endpoint connections associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def put( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # 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(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + """Deletes the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..e81bf85a23e0b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_storage_account( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py new file mode 100644 index 0000000000000..9e463917abce0 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py @@ -0,0 +1,416 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QueueOperations: + """QueueOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + queue: "_models.StorageQueue", + **kwargs + ) -> "_models.StorageQueue": + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + 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(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + queue: "_models.StorageQueue", + **kwargs + ) -> "_models.StorageQueue": + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + 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(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + **kwargs + ) -> "_models.StorageQueue": + """Gets the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + **kwargs + ) -> None: + """Deletes the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ListQueueResource"]: + """Gets a list of all the queues under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional, a maximum number of queues that should be included in a list + queue response. + :type maxpagesize: str + :param filter: Optional, When specified, only the queues with a name starting with the given + filter will be listed. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListQueueResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListQueueResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListQueueResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py new file mode 100644 index 0000000000000..b3d54004ad20e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py @@ -0,0 +1,239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QueueServicesOperations: + """QueueServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.ListQueueServices": + """List all queue services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListQueueServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListQueueServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('ListQueueServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.QueueServiceProperties", + **kwargs + ) -> "_models.QueueServiceProperties": + """Sets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Queue service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + queue_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_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') + + # 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(parameters, 'QueueServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.QueueServiceProperties": + """Gets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + queue_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py new file mode 100644 index 0000000000000..682e54407335e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SkusOperations: + """SkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.StorageSkuListResult"]: + """Lists the available SKUs supported by Microsoft.Storage for given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageSkuListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py new file mode 100644 index 0000000000000..61dfb7391ca65 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,1150 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", + **kwargs + ) -> "_models.CheckNameAvailabilityResult": + """Checks that the storage account name is valid and is not already in use. + + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountCreateParameters", + **kwargs + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'StorageAccountCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountCreateParameters", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Asynchronously creates a new storage account with the specified parameters. If an account is + already created and a subsequent create request is issued with different properties, the + account properties will be updated. If an account is already created and a subsequent create or + update request is issued with the exact same set of properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def get_properties( + self, + resource_group_name: str, + account_name: str, + expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, + **kwargs + ) -> "_models.StorageAccount": + """Returns the properties for the specified storage account including but not limited to name, SKU + name, location, and account status. The ListKeys operation should be used to retrieve storage + keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's properties. By default, + data is not included when fetching properties. Currently we only support geoReplicationStats + and blobRestoreStatus. + :type expand: str or ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountUpdateParameters", + **kwargs + ) -> "_models.StorageAccount": + """The update operation can be used to update the SKU, encryption, access tier, or tags for a + storage account. It can also be used to map the account to a custom domain. Only one custom + domain is supported per storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must be cleared/unregistered + before a new value can be set. The update of multiple properties is supported. This call does + not change the storage keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage account cannot be + changed after creation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'StorageAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.StorageAccountListResult"]: + """Lists all the storage accounts available under the subscription. Note that storage keys are not + returned; use the ListKeys operation for this. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StorageAccountListResult"]: + """Lists all the storage accounts available under the given resource group. Note that storage keys + are not returned; use the ListKeys operation for this. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + expand: Optional[str] = "kerb", + **kwargs + ) -> "_models.StorageAccountListKeysResult": + """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage + account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value is kerb. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(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('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} # type: ignore + + async def regenerate_key( + self, + resource_group_name: str, + account_name: str, + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", + **kwargs + ) -> "_models.StorageAccountListKeysResult": + """Regenerates one of the access keys or Kerberos keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param regenerate_key: Specifies name of the key which should be regenerated -- key1, key2, + kerb1, kerb2. + :type regenerate_key: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountRegenerateKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} # type: ignore + + async def list_account_sas( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.AccountSasParameters", + **kwargs + ) -> "_models.ListAccountSasResponse": + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials for the storage account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.AccountSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListAccountSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListAccountSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_account_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'AccountSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListAccountSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} # type: ignore + + async def list_service_sas( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.ServiceSasParameters", + **kwargs + ) -> "_models.ListServiceSasResponse": + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS credentials. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ServiceSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListServiceSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListServiceSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_service_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'ServiceSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListServiceSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} # type: ignore + + async def _failover_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self._failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + request = self._client.post(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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + async def begin_failover( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Failover request can be triggered for a storage account in case of availability issues. The + failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + accounts. The secondary cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + async def _restore_blob_ranges_initial( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobRestoreParameters", + **kwargs + ) -> "_models.BlobRestoreStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_blob_ranges_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'BlobRestoreParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _restore_blob_ranges_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + async def begin_restore_blob_ranges( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobRestoreParameters", + **kwargs + ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: + """Restore blobs in the specified blob ranges. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for restore blob ranges. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + 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._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + async def revoke_user_delegation_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + request = self._client.post(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) + + if cls: + return cls(pipeline_response, None, {}) + + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py new file mode 100644 index 0000000000000..a04c2aa446529 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py @@ -0,0 +1,384 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TableOperations: + """TableOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs + ) -> "_models.Table": + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs + ) -> "_models.Table": + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.patch(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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs + ) -> "_models.Table": + """Gets the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs + ) -> None: + """Deletes the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.ListTableResource"]: + """Gets a list of all the tables under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListTableResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListTableResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListTableResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py new file mode 100644 index 0000000000000..a16a6bf4f021b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py @@ -0,0 +1,239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TableServicesOperations: + """TableServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.ListTableServices": + """List all table services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListTableServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListTableServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('ListTableServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.TableServiceProperties", + **kwargs + ) -> "_models.TableServiceProperties": + """Sets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Table service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + table_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_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') + + # 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(parameters, 'TableServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.TableServiceProperties": + """Gets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + table_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py new file mode 100644 index 0000000000000..21474cd2c4caa --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations: + """UsagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_location( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.UsageListResult"]: + """Gets the current usage count and the limit for the resources of the location under the + subscription. + + :param location: The location of the Azure Storage resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.UsageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py new file mode 100644 index 0000000000000..caaa4098052b0 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py @@ -0,0 +1,493 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccountSasParameters + from ._models_py3 import ActiveDirectoryProperties + from ._models_py3 import AzureEntityResource + from ._models_py3 import AzureFilesIdentityBasedAuthentication + from ._models_py3 import BlobContainer + from ._models_py3 import BlobInventoryPolicy + from ._models_py3 import BlobInventoryPolicyDefinition + from ._models_py3 import BlobInventoryPolicyFilter + from ._models_py3 import BlobInventoryPolicyRule + from ._models_py3 import BlobInventoryPolicySchema + from ._models_py3 import BlobRestoreParameters + from ._models_py3 import BlobRestoreRange + from ._models_py3 import BlobRestoreStatus + from ._models_py3 import BlobServiceItems + from ._models_py3 import BlobServiceProperties + from ._models_py3 import ChangeFeed + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudErrorBody + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import DeletedAccount + from ._models_py3 import DeletedAccountListResult + from ._models_py3 import DeletedShare + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionScope + from ._models_py3 import EncryptionScopeKeyVaultProperties + from ._models_py3 import EncryptionScopeListResult + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseBody + from ._models_py3 import ExtendedLocation + from ._models_py3 import FileServiceItems + from ._models_py3 import FileServiceProperties + from ._models_py3 import FileShare + from ._models_py3 import FileShareItem + from ._models_py3 import FileShareItems + from ._models_py3 import GeoReplicationStats + from ._models_py3 import IPRule + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LastAccessTimeTrackingPolicy + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListBlobInventoryPolicy + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListQueue + from ._models_py3 import ListQueueResource + from ._models_py3 import ListQueueServices + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ListTableResource + from ._models_py3 import ListTableServices + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import MetricSpecification + from ._models_py3 import Multichannel + from ._models_py3 import NetworkRuleSet + from ._models_py3 import ObjectReplicationPolicies + from ._models_py3 import ObjectReplicationPolicy + from ._models_py3 import ObjectReplicationPolicyFilter + from ._models_py3 import ObjectReplicationPolicyRule + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProtocolSettings + from ._models_py3 import ProxyResource + from ._models_py3 import QueueServiceProperties + from ._models_py3 import Resource + from ._models_py3 import ResourceAccessRule + from ._models_py3 import RestorePolicyProperties + from ._models_py3 import Restriction + from ._models_py3 import RoutingPreference + from ._models_py3 import SKUCapability + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SkuInformation + from ._models_py3 import SmbSetting + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountInternetEndpoints + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountListResult + from ._models_py3 import StorageAccountMicrosoftEndpoints + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import StorageQueue + from ._models_py3 import StorageSkuListResult + from ._models_py3 import SystemData + from ._models_py3 import Table + from ._models_py3 import TableServiceProperties + from ._models_py3 import TagFilter + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageListResult + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule +except (SyntaxError, ImportError): + from ._models import AccountSasParameters # type: ignore + from ._models import ActiveDirectoryProperties # type: ignore + from ._models import AzureEntityResource # type: ignore + from ._models import AzureFilesIdentityBasedAuthentication # type: ignore + from ._models import BlobContainer # type: ignore + from ._models import BlobInventoryPolicy # type: ignore + from ._models import BlobInventoryPolicyDefinition # type: ignore + from ._models import BlobInventoryPolicyFilter # type: ignore + from ._models import BlobInventoryPolicyRule # type: ignore + from ._models import BlobInventoryPolicySchema # type: ignore + from ._models import BlobRestoreParameters # type: ignore + from ._models import BlobRestoreRange # type: ignore + from ._models import BlobRestoreStatus # type: ignore + from ._models import BlobServiceItems # type: ignore + from ._models import BlobServiceProperties # type: ignore + from ._models import ChangeFeed # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CorsRule # type: ignore + from ._models import CorsRules # type: ignore + from ._models import CustomDomain # type: ignore + from ._models import DateAfterCreation # type: ignore + from ._models import DateAfterModification # type: ignore + from ._models import DeleteRetentionPolicy # type: ignore + from ._models import DeletedAccount # type: ignore + from ._models import DeletedAccountListResult # type: ignore + from ._models import DeletedShare # type: ignore + from ._models import Dimension # type: ignore + from ._models import Encryption # type: ignore + from ._models import EncryptionScope # type: ignore + from ._models import EncryptionScopeKeyVaultProperties # type: ignore + from ._models import EncryptionScopeListResult # type: ignore + from ._models import EncryptionService # type: ignore + from ._models import EncryptionServices # type: ignore + from ._models import Endpoints # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseBody # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import FileServiceItems # type: ignore + from ._models import FileServiceProperties # type: ignore + from ._models import FileShare # type: ignore + from ._models import FileShareItem # type: ignore + from ._models import FileShareItems # type: ignore + from ._models import GeoReplicationStats # type: ignore + from ._models import IPRule # type: ignore + from ._models import Identity # type: ignore + from ._models import ImmutabilityPolicy # type: ignore + from ._models import ImmutabilityPolicyProperties # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import LastAccessTimeTrackingPolicy # type: ignore + from ._models import LeaseContainerRequest # type: ignore + from ._models import LeaseContainerResponse # type: ignore + from ._models import LegalHold # type: ignore + from ._models import LegalHoldProperties # type: ignore + from ._models import ListAccountSasResponse # type: ignore + from ._models import ListBlobInventoryPolicy # type: ignore + from ._models import ListContainerItem # type: ignore + from ._models import ListContainerItems # type: ignore + from ._models import ListQueue # type: ignore + from ._models import ListQueueResource # type: ignore + from ._models import ListQueueServices # type: ignore + from ._models import ListServiceSasResponse # type: ignore + from ._models import ListTableResource # type: ignore + from ._models import ListTableServices # type: ignore + from ._models import ManagementPolicy # type: ignore + from ._models import ManagementPolicyAction # type: ignore + from ._models import ManagementPolicyBaseBlob # type: ignore + from ._models import ManagementPolicyDefinition # type: ignore + from ._models import ManagementPolicyFilter # type: ignore + from ._models import ManagementPolicyRule # type: ignore + from ._models import ManagementPolicySchema # type: ignore + from ._models import ManagementPolicySnapShot # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import Multichannel # type: ignore + from ._models import NetworkRuleSet # type: ignore + from ._models import ObjectReplicationPolicies # type: ignore + from ._models import ObjectReplicationPolicy # type: ignore + from ._models import ObjectReplicationPolicyFilter # type: ignore + from ._models import ObjectReplicationPolicyRule # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProtocolSettings # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import QueueServiceProperties # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceAccessRule # type: ignore + from ._models import RestorePolicyProperties # type: ignore + from ._models import Restriction # type: ignore + from ._models import RoutingPreference # type: ignore + from ._models import SKUCapability # type: ignore + from ._models import ServiceSasParameters # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import SmbSetting # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCheckNameAvailabilityParameters # type: ignore + from ._models import StorageAccountCreateParameters # type: ignore + from ._models import StorageAccountInternetEndpoints # type: ignore + from ._models import StorageAccountKey # type: ignore + from ._models import StorageAccountListKeysResult # type: ignore + from ._models import StorageAccountListResult # type: ignore + from ._models import StorageAccountMicrosoftEndpoints # type: ignore + from ._models import StorageAccountRegenerateKeyParameters # type: ignore + from ._models import StorageAccountUpdateParameters # type: ignore + from ._models import StorageQueue # type: ignore + from ._models import StorageSkuListResult # type: ignore + from ._models import SystemData # type: ignore + from ._models import Table # type: ignore + from ._models import TableServiceProperties # type: ignore + from ._models import TagFilter # type: ignore + from ._models import TagProperty # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UpdateHistoryProperty # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageListResult # type: ignore + from ._models import UsageName # type: ignore + from ._models import VirtualNetworkRule # type: ignore + +from ._storage_management_client_enums import ( + AccessTier, + AccountStatus, + BlobInventoryPolicyName, + BlobRestoreProgressStatus, + Bypass, + CorsRuleAllowedMethodsItem, + CreatedByType, + DefaultAction, + DirectoryServiceOptions, + EnabledProtocols, + EncryptionScopeSource, + EncryptionScopeState, + ExtendedLocationTypes, + GeoReplicationStatus, + HttpProtocol, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, + InventoryRuleType, + KeyPermission, + KeySource, + KeyType, + Kind, + LargeFileSharesState, + LeaseContainerRequestAction, + LeaseDuration, + LeaseState, + LeaseStatus, + ListContainersInclude, + ListSharesExpand, + ManagementPolicyName, + MinimumTlsVersion, + Name, + Permissions, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicAccess, + Reason, + ReasonCode, + RootSquashType, + RoutingChoice, + RuleType, + Services, + ShareAccessTier, + SignedResource, + SignedResourceTypes, + SkuName, + SkuTier, + State, + StorageAccountExpand, + UsageUnit, +) + +__all__ = [ + 'AccountSasParameters', + 'ActiveDirectoryProperties', + 'AzureEntityResource', + 'AzureFilesIdentityBasedAuthentication', + 'BlobContainer', + 'BlobInventoryPolicy', + 'BlobInventoryPolicyDefinition', + 'BlobInventoryPolicyFilter', + 'BlobInventoryPolicyRule', + 'BlobInventoryPolicySchema', + 'BlobRestoreParameters', + 'BlobRestoreRange', + 'BlobRestoreStatus', + 'BlobServiceItems', + 'BlobServiceProperties', + 'ChangeFeed', + 'CheckNameAvailabilityResult', + 'CloudErrorBody', + 'CorsRule', + 'CorsRules', + 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeleteRetentionPolicy', + 'DeletedAccount', + 'DeletedAccountListResult', + 'DeletedShare', + 'Dimension', + 'Encryption', + 'EncryptionScope', + 'EncryptionScopeKeyVaultProperties', + 'EncryptionScopeListResult', + 'EncryptionService', + 'EncryptionServices', + 'Endpoints', + 'ErrorResponse', + 'ErrorResponseBody', + 'ExtendedLocation', + 'FileServiceItems', + 'FileServiceProperties', + 'FileShare', + 'FileShareItem', + 'FileShareItems', + 'GeoReplicationStats', + 'IPRule', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'KeyVaultProperties', + 'LastAccessTimeTrackingPolicy', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListBlobInventoryPolicy', + 'ListContainerItem', + 'ListContainerItems', + 'ListQueue', + 'ListQueueResource', + 'ListQueueServices', + 'ListServiceSasResponse', + 'ListTableResource', + 'ListTableServices', + 'ManagementPolicy', + 'ManagementPolicyAction', + 'ManagementPolicyBaseBlob', + 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', + 'ManagementPolicyRule', + 'ManagementPolicySchema', + 'ManagementPolicySnapShot', + 'MetricSpecification', + 'Multichannel', + 'NetworkRuleSet', + 'ObjectReplicationPolicies', + 'ObjectReplicationPolicy', + 'ObjectReplicationPolicyFilter', + 'ObjectReplicationPolicyRule', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProtocolSettings', + 'ProxyResource', + 'QueueServiceProperties', + 'Resource', + 'ResourceAccessRule', + 'RestorePolicyProperties', + 'Restriction', + 'RoutingPreference', + 'SKUCapability', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SkuInformation', + 'SmbSetting', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountInternetEndpoints', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountListResult', + 'StorageAccountMicrosoftEndpoints', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'StorageQueue', + 'StorageSkuListResult', + 'SystemData', + 'Table', + 'TableServiceProperties', + 'TagFilter', + 'TagProperty', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageListResult', + 'UsageName', + 'VirtualNetworkRule', + 'AccessTier', + 'AccountStatus', + 'BlobInventoryPolicyName', + 'BlobRestoreProgressStatus', + 'Bypass', + 'CorsRuleAllowedMethodsItem', + 'CreatedByType', + 'DefaultAction', + 'DirectoryServiceOptions', + 'EnabledProtocols', + 'EncryptionScopeSource', + 'EncryptionScopeState', + 'ExtendedLocationTypes', + 'GeoReplicationStatus', + 'HttpProtocol', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', + 'InventoryRuleType', + 'KeyPermission', + 'KeySource', + 'KeyType', + 'Kind', + 'LargeFileSharesState', + 'LeaseContainerRequestAction', + 'LeaseDuration', + 'LeaseState', + 'LeaseStatus', + 'ListContainersInclude', + 'ListSharesExpand', + 'ManagementPolicyName', + 'MinimumTlsVersion', + 'Name', + 'Permissions', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'PublicAccess', + 'Reason', + 'ReasonCode', + 'RootSquashType', + 'RoutingChoice', + 'RuleType', + 'Services', + 'ShareAccessTier', + 'SignedResource', + 'SignedResourceTypes', + 'SkuName', + 'SkuTier', + 'State', + 'StorageAccountExpand', + 'UsageUnit', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py new file mode 100644 index 0000000000000..b07a480084e2d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py @@ -0,0 +1,5125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 AccountSasParameters(msrest.serialization.Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account SAS. Possible values + include: Blob (b), Queue (q), Table (t), File (f). Possible values include: "b", "q", "t", "f". + :type services: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Services + :param resource_types: Required. The signed resource types that are accessible with the account + SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; + Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: "s", "c", "o". + :type resource_types: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. Possible values + include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process + (p). Possible values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: Required. The time at which the shared access signature + becomes invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs['services'] + self.resource_types = kwargs['resource_types'] + self.permissions = kwargs['permissions'] + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs['shared_access_expiry_time'] + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class ActiveDirectoryProperties(msrest.serialization.Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS server is + authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = kwargs['domain_name'] + self.net_bios_domain_name = kwargs['net_bios_domain_name'] + self.forest_name = kwargs['forest_name'] + self.domain_guid = kwargs['domain_guid'] + self.domain_sid = kwargs['domain_sid'] + self.azure_storage_sid = kwargs['azure_storage_sid'] + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with an etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(msrest.serialization.Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory service used. Possible + values include: "None", "AADDS", "AD". + :type directory_service_options: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = kwargs['directory_service_options'] + self.active_directory_properties = kwargs.get('active_directory_properties', None) + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2020_08_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobContainer, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobInventoryPolicy(Resource): + """The storage account blob inventory policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.storage.v2020_08_01_preview.models.SystemData + :ivar last_modified_time: Returns the last modified date and time of the blob inventory policy. + :vartype last_modified_time: ~datetime.datetime + :param policy: The storage account blob inventory policy object. It is composed of policy + rules. + :type policy: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'BlobInventoryPolicySchema'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicy, self).__init__(**kwargs) + self.system_data = None + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class BlobInventoryPolicyDefinition(msrest.serialization.Model): + """An object that defines the blob inventory rule. Each definition consists of a set of filters. + + All required parameters must be populated in order to send to Azure. + + :param filters: Required. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyFilter + """ + + _validation = { + 'filters': {'required': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'BlobInventoryPolicyFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyDefinition, self).__init__(**kwargs) + self.filters = kwargs['filters'] + + +class BlobInventoryPolicyFilter(msrest.serialization.Model): + """An object that defines the blob inventory rule filter conditions. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for blob prefixes to be matched. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Valid values include + blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. + :type blob_types: list[str] + :param include_blob_versions: Includes blob versions in blob inventory when value set to true. + :type include_blob_versions: bool + :param include_snapshots: Includes blob snapshots in blob inventory when value set to true. + :type include_snapshots: bool + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'include_blob_versions': {'key': 'includeBlobVersions', 'type': 'bool'}, + 'include_snapshots': {'key': 'includeSnapshots', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs['blob_types'] + self.include_blob_versions = kwargs.get('include_blob_versions', None) + self.include_snapshots = kwargs.get('include_snapshots', None) + + +class BlobInventoryPolicyRule(msrest.serialization.Model): + """An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Rule is enabled when set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param definition: Required. An object that defines the blob inventory policy rule. + :type definition: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyDefinition + """ + + _validation = { + 'enabled': {'required': True}, + 'name': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'BlobInventoryPolicyDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.name = kwargs['name'] + self.definition = kwargs['definition'] + + +class BlobInventoryPolicySchema(msrest.serialization.Model): + """The storage account blob inventory policy rules. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Policy is enabled if set to true. + :type enabled: bool + :param destination: Required. Container name where blob inventory files are stored. Must be + pre-created. + :type destination: str + :param type: Required. The valid value is Inventory. Possible values include: "Inventory". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.InventoryRuleType + :param rules: Required. The storage account blob inventory policy rules. The rule is applied + when it is enabled. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyRule] + """ + + _validation = { + 'enabled': {'required': True}, + 'destination': {'required': True}, + 'type': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[BlobInventoryPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicySchema, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.destination = kwargs['destination'] + self.type = kwargs['type'] + self.rules = kwargs['rules'] + + +class BlobRestoreParameters(msrest.serialization.Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: ~datetime.datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = kwargs['time_to_restore'] + self.blob_ranges = kwargs['blob_ranges'] + + +class BlobRestoreRange(msrest.serialization.Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = kwargs['start_range'] + self.end_range = kwargs['end_range'] + + +class BlobRestoreStatus(msrest.serialization.Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - InProgress: Indicates + that blob restore is ongoing. - Complete: Indicates that blob restore has been completed + successfully. - Failed: Indicates that blob restore is failed. Possible values include: + "InProgress", "Complete", "Failed". + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceItems(msrest.serialization.Model): + """BlobServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceItems, self).__init__(**kwargs) + self.value = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the default version to use for + requests to the Blob service if an incoming request’s version is not specified. Possible values + include version 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2020_08_01_preview.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore policy. + :type restore_policy: ~azure.mgmt.storage.v2020_08_01_preview.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for container soft + delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param last_access_time_tracking_policy: The blob service property to configure last access + time based tracking policy. + :type last_access_time_tracking_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.LastAccessTimeTrackingPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'last_access_time_tracking_policy': {'key': 'properties.lastAccessTimeTrackingPolicy', 'type': 'LastAccessTimeTrackingPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None) + self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + self.change_feed = kwargs.get('change_feed', None) + self.restore_policy = kwargs.get('restore_policy', None) + self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None) + self.last_access_time_tracking_policy = kwargs.get('last_access_time_tracking_policy', None) + + +class ChangeFeed(msrest.serialization.Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or is invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be used. The Reason element + is only returned if NameAvailable is false. Possible values include: "AccountNameInvalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Reason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CorsRule(msrest.serialization.Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. A list of origin + domains that will be allowed via CORS, or "*" to allow all domains. + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. A list of HTTP + methods that are allowed to be executed by the origin. + :type allowed_methods: list[str or + ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRuleAllowedMethodsItem] + :param max_age_in_seconds: Required. Required if CorsRule element is present. The number of + seconds that the client/browser should cache a preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. A list of response + headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. A list of headers + allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs['allowed_origins'] + self.allowed_methods = kwargs['allowed_methods'] + self.max_age_in_seconds = kwargs['max_age_in_seconds'] + self.exposed_headers = kwargs['exposed_headers'] + self.allowed_headers = kwargs['allowed_headers'] + + +class CorsRules(msrest.serialization.Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the request. + + :param cors_rules: The List of CORS rules. You can include up to five CorsRule elements in the + request. + :type cors_rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(msrest.serialization.Model): + """The custom domain assigned to this storage account. This can be set via Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the storage account. + Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default + value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs['name'] + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(msrest.serialization.Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the age in days after + creation. + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs['days_after_creation_greater_than'] + + +class DateAfterModification(msrest.serialization.Model): + """Object to define the number of days after last modification. + + :param days_after_modification_greater_than: Value indicating the age in days after last + modification. + :type days_after_modification_greater_than: float + :param days_after_last_access_time_greater_than: Value indicating the age in days after last + blob access. This property can only be used in conjunction with last access time tracking + policy. + :type days_after_last_access_time_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'minimum': 0, 'multiple': 1}, + 'days_after_last_access_time_greater_than': {'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + 'days_after_last_access_time_greater_than': {'key': 'daysAfterLastAccessTimeGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + self.days_after_last_access_time_greater_than = kwargs.get('days_after_last_access_time_greater_than', None) + + +class DeletedAccount(Resource): + """Deleted storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar storage_account_resource_id: Full resource id of the original storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted account via + PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedAccountListResult(msrest.serialization.Model): + """The response from the List Deleted Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of deleted accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount] + :ivar next_link: Request URL that can be used to query next page of deleted accounts. Returned + when total number of requested deleted accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DeletedShare(msrest.serialization.Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the deleted share that will + be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of the deleted share + that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = kwargs['deleted_share_name'] + self.deleted_share_version = kwargs['deleted_share_version'] + + +class DeleteRetentionPolicy(msrest.serialization.Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be retained. The minimum + specified value can be 1 and the maximum value can be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(msrest.serialization.Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible values (case- + insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: + "Microsoft.Storage", "Microsoft.Keyvault". Default value: "Microsoft.Storage". + :type key_source: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: ~azure.mgmt.storage.v2020_08_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param source: The provider for the encryption scope. Possible values (case-insensitive): + Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", + "Microsoft.KeyVault". + :type source: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values (case-insensitive): Enabled, + Disabled. Possible values include: "Enabled", "Disabled". + :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption scope in UTC. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modification date and time of the encryption scope in + UTC. + :vartype last_modified_time: ~datetime.datetime + :param key_vault_properties: The key vault properties for the encryption scope. This is a + required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScope, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScopeKeyVaultProperties(msrest.serialization.Model): + """The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When applied, the encryption + scope will use the key referenced by the identifier to enable customer-managed key support on + this encryption scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = kwargs.get('key_uri', None) + + +class EncryptionScopeListResult(msrest.serialization.Model): + """List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of encryption scopes requested. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope] + :ivar next_link: Request URL that can be used to query next page of encryption scopes. Returned + when total number of requested encryption scopes exceeds the maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EncryptionScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EncryptionService(msrest.serialization.Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts the data as it is + stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the encryption was last + enabled by the user. Only returned when encryption is enabled. There might be some unencrypted + blobs which were written after this time, as it is just a rough estimate. + :vartype last_enabled_time: ~datetime.datetime + :param key_type: Encryption key type to be used for the encryption service. 'Account' key type + implies that an account-scoped encryption key will be used. 'Service' key type implies that a + default service key is used. Possible values include: "Service", "Account". + :type key_type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + self.key_type = kwargs.get('key_type', None) + + +class EncryptionServices(msrest.serialization.Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = kwargs.get('table', None) + self.queue = kwargs.get('queue', None) + + +class Endpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints. + :type internet_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__( + self, + **kwargs + ): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = kwargs.get('microsoft_endpoints', None) + self.internet_endpoints = kwargs.get('internet_endpoints', None) + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: ~azure.mgmt.storage.v2020_08_01_preview.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class FileServiceItems(msrest.serialization.Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param share_delete_retention_policy: The file service properties for share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param protocol_settings: Protocol settings for file service. + :type protocol_settings: ~azure.mgmt.storage.v2020_08_01_preview.models.ProtocolSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'protocol_settings': {'key': 'properties.protocolSettings', 'type': 'ProtocolSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = kwargs.get('cors', None) + self.share_delete_retention_policy = kwargs.get('share_delete_retention_policy', None) + self.protocol_settings = kwargs.get('protocol_settings', None) + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.snapshot_time = None + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.snapshot_time = None + + +class FileShareItems(msrest.serialization.Model): + """Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of shares. Returned when total + number of requested shares exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GeoReplicationStats(msrest.serialization.Model): + """Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when geo-redundant replication is enabled for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of the secondary location. Possible values are: - Live: Indicates that + the secondary location is active and operational. - Bootstrap: Indicates initial + synchronization from the primary location to the secondary location is in progress.This + typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: "Live", "Bootstrap", + "Unavailable". + :vartype status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time value are guaranteed to + be available for read operations. Primary writes following this point in time may or may not be + available for reads. Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: ~datetime.datetime + :ivar can_failover: A boolean flag which indicates whether or not account failover is supported + for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + + +class ImmutabilityPolicyProperties(msrest.serialization.Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob container. + :vartype update_history: + list[~azure.mgmt.storage.v2020_08_01_preview.models.UpdateHistoryProperty] + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.etag = None + self.update_history = None + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + + +class IPRule(msrest.serialization.Model): + """IP rule with specific IP or IP range in CIDR format. + + Variables are only 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 ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 + address is allowed. + :type ip_address_or_range: str + :ivar action: The action of IP ACL rule. Default value: "Allow". + :vartype action: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + 'action': {'constant': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + action = "Allow" + + def __init__( + self, + **kwargs + ): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs['ip_address_or_range'] + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LastAccessTimeTrackingPolicy(msrest.serialization.Model): + """The blob service properties for Last access time based tracking policy. + + All required parameters must be populated in order to send to Azure. + + :param enable: Required. When set to true last access time based tracking is enabled. + :type enable: bool + :param name: Name of the policy. The valid value is AccessTimeTracking. This field is currently + read only. Possible values include: "AccessTimeTracking". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Name + :param tracking_granularity_in_days: The field specifies blob object tracking granularity in + days, typically how often the blob object should be tracked.This field is currently read only + with value as 1. + :type tracking_granularity_in_days: int + :param blob_type: An array of predefined supported blob types. Only blockBlob is the supported + value. This field is currently read only. + :type blob_type: list[str] + """ + + _validation = { + 'enable': {'required': True}, + } + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tracking_granularity_in_days': {'key': 'trackingGranularityInDays', 'type': 'int'}, + 'blob_type': {'key': 'blobType', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LastAccessTimeTrackingPolicy, self).__init__(**kwargs) + self.enable = kwargs['enable'] + self.name = kwargs.get('name', None) + self.tracking_granularity_in_days = kwargs.get('tracking_granularity_in_days', None) + self.blob_type = kwargs.get('blob_type', None) + + +class LeaseContainerRequest(msrest.serialization.Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerRequestAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs['action'] + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(msrest.serialization.Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + container, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. A set of tags. Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs['tags'] + + +class LegalHoldProperties(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: A set of tags. The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2020_08_01_preview.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(msrest.serialization.Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListBlobInventoryPolicy(msrest.serialization.Model): + """List of blob inventory policies returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob inventory policies. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobInventoryPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListBlobInventoryPolicy, self).__init__(**kwargs) + self.value = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2020_08_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItem, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(msrest.serialization.Model): + """Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blobs containers returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItem] + :ivar next_link: Request URL that can be used to query next page of containers. Returned when + total number of requested containers exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueue(Resource): + """ListQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + + +class ListQueueResource(msrest.serialization.Model): + """Response schema. Contains list of queues returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queues returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ListQueue] + :ivar next_link: Request URL that can be used to list next page of queues. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListQueue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueueServices(msrest.serialization.Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queue services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +class ListServiceSasResponse(msrest.serialization.Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_sas_token: List service SAS credentials of specific resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ListTableResource(msrest.serialization.Model): + """Response schema. Contains list of tables returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of tables returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Table] + :ivar next_link: Request URL that can be used to query next page of tables. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Table]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListTableServices(msrest.serialization.Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of table services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. + :vartype last_modified_time: ~datetime.datetime + :param policy: The Storage Account ManagementPolicy, in JSON format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(msrest.serialization.Model): + """Actions are applied to the filtered blobs when the execution condition is met. + + :param base_blob: The management policy action for base blob. + :type base_blob: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot. + :type snapshot: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + + +class ManagementPolicyBaseBlob(msrest.serialization.Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support blobs currently at Hot + tier. + :type tier_to_cool: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. Support blobs currently + at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param delete: The function to delete the blob. + :type delete: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param enable_auto_tier_to_hot_from_cool: This property enables auto tiering of a blob from + cool to hot on a blob access. This property requires + tierToCool.daysAfterLastAccessTimeGreaterThan. + :type enable_auto_tier_to_hot_from_cool: bool + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + 'enable_auto_tier_to_hot_from_cool': {'key': 'enableAutoTierToHotFromCool', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + self.enable_auto_tier_to_hot_from_cool = kwargs.get('enable_auto_tier_to_hot_from_cool', None) + + +class ManagementPolicyDefinition(msrest.serialization.Model): + """An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs['actions'] + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(msrest.serialization.Model): + """Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only blockBlob is supported. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there can be at most 10 tag + filters. + :type blob_index_match: list[~azure.mgmt.storage.v2020_08_01_preview.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs['blob_types'] + self.blob_index_match = kwargs.get('blob_index_match', None) + + +class ManagementPolicyRule(msrest.serialization.Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param type: Required. The valid value is Lifecycle. Possible values include: "Lifecycle". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RuleType + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.definition = kwargs['definition'] + + +class ManagementPolicySchema(msrest.serialization.Model): + """The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs['rules'] + + +class ManagementPolicySnapShot(msrest.serialization.Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot. + :type delete: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = kwargs.get('delete', None) + + +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access tier. + :type dimensions: list[~azure.mgmt.storage.v2020_08_01_preview.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class Multichannel(msrest.serialization.Model): + """Multichannel setting. Applies to Premium FileStorage only. + + :param enabled: Indicates whether multichannel is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Multichannel, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class NetworkRuleSet(msrest.serialization.Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, + Metrics"), or None to bypass none of those traffics. Possible values include: "None", + "Logging", "Metrics", "AzureServices". Default value: "AzureServices". + :type bypass: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Bypass + :param resource_access_rules: + :type resource_access_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules. + :type ip_rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.IPRule] + :param default_action: Required. Specifies the default action of allow or deny when no other + rules match. Possible values include: "Allow", "Deny". Default value: "Allow". + :type default_action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.resource_access_rules = kwargs.get('resource_access_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class ObjectReplicationPolicies(msrest.serialization.Model): + """List storage account object replication policies. + + :param value: The replication policy between two storage accounts. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ObjectReplicationPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicies, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be defined in one policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source account. + :vartype enabled_time: ~datetime.datetime + :param source_account: Required. Source account name. + :type source_account: str + :param destination_account: Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = kwargs.get('source_account', None) + self.destination_account = kwargs.get('destination_account', None) + self.rules = kwargs.get('rules', None) + + +class ObjectReplicationPolicyFilter(msrest.serialization.Model): + """Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs whose names begin + with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated to the destination. + It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.min_creation_time = kwargs.get('min_creation_time', None) + + +class ObjectReplicationPolicyRule(msrest.serialization.Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination account. It is + required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.source_container = kwargs['source_container'] + self.destination_container = kwargs['destination_container'] + self.filters = kwargs.get('filters', None) + + +class Operation(msrest.serialization.Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2020_08_01_preview.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: + ~azure.mgmt.storage.v2020_08_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :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 OperationListResult(msrest.serialization.Model): + """Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource provider. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + +class ProtocolSettings(msrest.serialization.Model): + """Protocol settings for file service. + + :param smb: Setting for SMB protocol. + :type smb: ~azure.mgmt.storage.v2020_08_01_preview.models.SmbSetting + """ + + _attribute_map = { + 'smb': {'key': 'smb', 'type': 'SmbSetting'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtocolSettings, self).__init__(**kwargs) + self.smb = kwargs.get('smb', None) + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + **kwargs + ): + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class ResourceAccessRule(msrest.serialization.Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id. + :type tenant_id: str + :param resource_id: Resource Id. + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.resource_id = kwargs.get('resource_id', None) + + +class RestorePolicyProperties(msrest.serialization.Model): + """The blob service properties for blob restore policy. + + Variables are only 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 enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than zero and less than + DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: ~datetime.datetime + :ivar min_restore_time: Returns the minimum date and time that the restore can be started. + :vartype min_restore_time: ~datetime.datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.days = kwargs.get('days', None) + self.last_enabled_time = None + self.min_restore_time = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. Possible values include: "QuotaId", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class RoutingPreference(msrest.serialization.Model): + """Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, the default option is microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing opted by the user. + Possible values include: "MicrosoftRouting", "InternetRouting". + :type routing_choice: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether microsoft routing + storage endpoints are to be published. + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether internet routing + storage endpoints are to be published. + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = kwargs.get('routing_choice', None) + self.publish_microsoft_endpoints = kwargs.get('publish_microsoft_endpoints', None) + self.publish_internet_endpoints = kwargs.get('publish_internet_endpoints', None) + + +class ServiceSasParameters(msrest.serialization.Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. Possible values include: + Blob (b), Container (c), File (f), Share (s). Possible values include: "b", "c", "f", "s". + :type resource: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible values include: Read + (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible + values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: The time at which the shared access signature becomes + invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param identifier: A unique value up to 64 characters in length that correlates to an access + policy specified for the container, queue, or table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content disposition. + :type content_disposition: str + :param content_encoding: The response header override for content encoding. + :type content_encoding: str + :param content_language: The response header override for content language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64, 'min_length': 0}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs['canonicalized_resource'] + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2020_08_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(msrest.serialization.Model): + """The SKU of the storage account. + + Variables are only 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 name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + + +class SKUCapability(msrest.serialization.Model): + """The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of capability, The capability information in the specified SKU, including + file encryption, network ACLs, change notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(msrest.serialization.Model): + """Storage SKU and its properties. + + Variables are only 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 name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + :ivar resource_type: The type of the resource, usually it is 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values include: "Storage", + "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + :vartype capabilities: list[~azure.mgmt.storage.v2020_08_01_preview.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.storage.v2020_08_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SmbSetting(msrest.serialization.Model): + """Setting for SMB protocol. + + :param multichannel: Multichannel setting. Applies to Premium FileStorage only. + :type multichannel: ~azure.mgmt.storage.v2020_08_01_preview.models.Multichannel + """ + + _attribute_map = { + 'multichannel': {'key': 'multichannel', 'type': 'Multichannel'}, + } + + def __init__( + self, + **kwargs + ): + super(SmbSetting, self).__init__(**kwargs) + self.multichannel = kwargs.get('multichannel', None) + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocation + :ivar provisioning_state: Gets the status of the storage account at the time the operation was + called. Possible values include: "Creating", "ResolvingDNS", "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob + endpoint. + :vartype primary_endpoints: ~azure.mgmt.storage.v2020_08_01_preview.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary location of the storage + account is available or unavailable. Possible values include: "available", "unavailable". + :vartype status_of_primary: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent instance of a failover to + the secondary location. Only the most recent timestamp is retained. This element is not + returned if there has never been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: ~datetime.datetime + :ivar secondary_location: Gets the location of the geo-replicated secondary for the storage + account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the secondary location of the + storage account is available or unavailable. Only available if the SKU name is Standard_GRS or + Standard_RAGRS. Possible values include: "available", "unavailable". + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage account in UTC. + :vartype creation_time: ~datetime.datetime + :ivar custom_domain: Gets the custom domain the user assigned to this storage account. + :vartype custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object from the secondary location of the storage account. Only available if + the SKU name is Standard_RAGRS. + :vartype secondary_endpoints: ~azure.mgmt.storage.v2020_08_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If unspecified, the account is + unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. The access tier used + for billing. Possible values include: "Hot", "Cool". + :vartype access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set. + :vartype network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats. + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will be true, otherwise, + it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection associated with the + specified storage account. + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :ivar blob_restore_status: Blob restore status. + :vartype blob_restore_status: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'str'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.extended_location = kwargs.get('extended_location', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.private_endpoint_connections = None + self.routing_preference = kwargs.get('routing_preference', None) + self.blob_restore_status = None + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + + +class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): + """The parameters used to check the availability of the storage account name. + + Variables are only 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 name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__( + self, + **kwargs + ): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class StorageAccountCreateParameters(msrest.serialization.Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param kind: Required. Required. Indicates the type of storage account. Possible values + include: "Storage", "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param location: Required. Required. Gets or sets the location of the resource. This will be + one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + etc.). The geo region of a resource cannot be changed once it is created, but if an identical + geo region is specified on update, the request will succeed. + :type location: str + :param extended_location: Optional. Set the extended location of the resource. If not set, the + storage account will be created in Azure main region. Otherwise it will be created in the + specified extended location. + :type extended_location: ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocation + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used for viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no + greater than 128 characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is the CNAME source. + Only one custom domain is supported per storage account at this time. To clear the existing + custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for all storage accounts + and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + The default value is true since API version 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.kind = kwargs['kind'] + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + + +class StorageAccountInternetEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(msrest.serialization.Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full permissions. Possible values + include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(msrest.serialization.Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for the specified + storage account. + :vartype keys: list[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountListResult(msrest.serialization.Model): + """The response from the List Storage Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of storage accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :ivar next_link: Request URL that can be used to query next page of storage accounts. Returned + when total number of requested storage accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountMicrosoftEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(msrest.serialization.Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be regenerated, possible + values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs['key_name'] + + +class StorageAccountUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating the storage account properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be updated to + Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any + other value. + :type sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in + length than 128 characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value + supported by server. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param custom_domain: Custom domain assigned to the storage account by the user. Name is the + CNAME source. Only one custom domain is supported per storage account at this time. To clear + the existing custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The default setting is + unencrypted. + :type encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.kind = kwargs.get('kind', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + + +class StorageQueue(Resource): + """StorageQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number of messages in the + queue. This number is not lower than the actual number of messages in the queue, but could be + higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.approximate_message_count = None + + +class StorageSkuListResult(msrest.serialization.Model): + """The response from the List Storage SKUs operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Get the list result of storage SKUs and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.SkuInformation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSkuListResult, self).__init__(**kwargs) + self.value = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _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(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar table_name: Table name under the specified account. + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + **kwargs + ): + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class TagFilter(msrest.serialization.Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 characters. + :type name: str + :param op: Required. This is the comparison operator which is used for object comparison and + filtering. Only == (equality operator) is currently supported. + :type op: str + :param value: Required. This is the filter tag value field used for tag based filtering, it can + have 0 - 256 characters. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagFilter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.op = kwargs['op'] + self.value = kwargs['value'] + + +class TagProperty(msrest.serialization.Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who added the tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(msrest.serialization.Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, possible values include: + put, lock and extend. Possible values include: "put", "lock", "extend". + :vartype update: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was updated. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who updated the ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who updated the + ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(msrest.serialization.Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountsPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.storage.v2020_08_01_preview.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2020_08_01_preview.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageListResult(msrest.serialization.Model): + """The response from the List Usages operation. + + :param value: Gets or sets the list of Storage Resource Usages. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class UsageName(msrest.serialization.Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(msrest.serialization.Model): + """Virtual Network rule. + + Variables are only 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 virtual_network_resource_id: Required. Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :ivar action: The action of virtual network rule. Default value: "Allow". + :vartype action: str + :param state: Gets the state of virtual network rule. Possible values include: "provisioning", + "deprovisioning", "succeeded", "failed", "networkSourceDeleted". + :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + 'action': {'constant': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + action = "Allow" + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py new file mode 100644 index 0000000000000..de5d7da661cb3 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py @@ -0,0 +1,5502 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._storage_management_client_enums import * + + +class AccountSasParameters(msrest.serialization.Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account SAS. Possible values + include: Blob (b), Queue (q), Table (t), File (f). Possible values include: "b", "q", "t", "f". + :type services: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Services + :param resource_types: Required. The signed resource types that are accessible with the account + SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; + Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: "s", "c", "o". + :type resource_types: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. Possible values + include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process + (p). Possible values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: Required. The time at which the shared access signature + becomes invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__( + self, + *, + services: Union[str, "Services"], + resource_types: Union[str, "SignedResourceTypes"], + permissions: Union[str, "Permissions"], + shared_access_expiry_time: datetime.datetime, + ip_address_or_range: Optional[str] = None, + protocols: Optional[Union[str, "HttpProtocol"]] = None, + shared_access_start_time: Optional[datetime.datetime] = None, + key_to_sign: Optional[str] = None, + **kwargs + ): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class ActiveDirectoryProperties(msrest.serialization.Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS server is + authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name: str, + net_bios_domain_name: str, + forest_name: str, + domain_guid: str, + domain_sid: str, + azure_storage_sid: str, + **kwargs + ): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = domain_name + self.net_bios_domain_name = net_bios_domain_name + self.forest_name = forest_name + self.domain_guid = domain_guid + self.domain_sid = domain_sid + self.azure_storage_sid = azure_storage_sid + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with an etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(msrest.serialization.Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory service used. Possible + values include: "None", "AADDS", "AD". + :type directory_service_options: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__( + self, + *, + directory_service_options: Union[str, "DirectoryServiceOptions"], + active_directory_properties: Optional["ActiveDirectoryProperties"] = None, + **kwargs + ): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = directory_service_options + self.active_directory_properties = active_directory_properties + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2020_08_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__( + self, + *, + default_encryption_scope: Optional[str] = None, + deny_encryption_scope_override: Optional[bool] = None, + public_access: Optional[Union[str, "PublicAccess"]] = None, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(BlobContainer, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobInventoryPolicy(Resource): + """The storage account blob inventory policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.storage.v2020_08_01_preview.models.SystemData + :ivar last_modified_time: Returns the last modified date and time of the blob inventory policy. + :vartype last_modified_time: ~datetime.datetime + :param policy: The storage account blob inventory policy object. It is composed of policy + rules. + :type policy: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'BlobInventoryPolicySchema'}, + } + + def __init__( + self, + *, + policy: Optional["BlobInventoryPolicySchema"] = None, + **kwargs + ): + super(BlobInventoryPolicy, self).__init__(**kwargs) + self.system_data = None + self.last_modified_time = None + self.policy = policy + + +class BlobInventoryPolicyDefinition(msrest.serialization.Model): + """An object that defines the blob inventory rule. Each definition consists of a set of filters. + + All required parameters must be populated in order to send to Azure. + + :param filters: Required. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyFilter + """ + + _validation = { + 'filters': {'required': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'BlobInventoryPolicyFilter'}, + } + + def __init__( + self, + *, + filters: "BlobInventoryPolicyFilter", + **kwargs + ): + super(BlobInventoryPolicyDefinition, self).__init__(**kwargs) + self.filters = filters + + +class BlobInventoryPolicyFilter(msrest.serialization.Model): + """An object that defines the blob inventory rule filter conditions. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for blob prefixes to be matched. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Valid values include + blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. + :type blob_types: list[str] + :param include_blob_versions: Includes blob versions in blob inventory when value set to true. + :type include_blob_versions: bool + :param include_snapshots: Includes blob snapshots in blob inventory when value set to true. + :type include_snapshots: bool + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'include_blob_versions': {'key': 'includeBlobVersions', 'type': 'bool'}, + 'include_snapshots': {'key': 'includeSnapshots', 'type': 'bool'}, + } + + def __init__( + self, + *, + blob_types: List[str], + prefix_match: Optional[List[str]] = None, + include_blob_versions: Optional[bool] = None, + include_snapshots: Optional[bool] = None, + **kwargs + ): + super(BlobInventoryPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + self.include_blob_versions = include_blob_versions + self.include_snapshots = include_snapshots + + +class BlobInventoryPolicyRule(msrest.serialization.Model): + """An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Rule is enabled when set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param definition: Required. An object that defines the blob inventory policy rule. + :type definition: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyDefinition + """ + + _validation = { + 'enabled': {'required': True}, + 'name': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'BlobInventoryPolicyDefinition'}, + } + + def __init__( + self, + *, + enabled: bool, + name: str, + definition: "BlobInventoryPolicyDefinition", + **kwargs + ): + super(BlobInventoryPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.definition = definition + + +class BlobInventoryPolicySchema(msrest.serialization.Model): + """The storage account blob inventory policy rules. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Policy is enabled if set to true. + :type enabled: bool + :param destination: Required. Container name where blob inventory files are stored. Must be + pre-created. + :type destination: str + :param type: Required. The valid value is Inventory. Possible values include: "Inventory". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.InventoryRuleType + :param rules: Required. The storage account blob inventory policy rules. The rule is applied + when it is enabled. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyRule] + """ + + _validation = { + 'enabled': {'required': True}, + 'destination': {'required': True}, + 'type': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[BlobInventoryPolicyRule]'}, + } + + def __init__( + self, + *, + enabled: bool, + destination: str, + type: Union[str, "InventoryRuleType"], + rules: List["BlobInventoryPolicyRule"], + **kwargs + ): + super(BlobInventoryPolicySchema, self).__init__(**kwargs) + self.enabled = enabled + self.destination = destination + self.type = type + self.rules = rules + + +class BlobRestoreParameters(msrest.serialization.Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: ~datetime.datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__( + self, + *, + time_to_restore: datetime.datetime, + blob_ranges: List["BlobRestoreRange"], + **kwargs + ): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = time_to_restore + self.blob_ranges = blob_ranges + + +class BlobRestoreRange(msrest.serialization.Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__( + self, + *, + start_range: str, + end_range: str, + **kwargs + ): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = start_range + self.end_range = end_range + + +class BlobRestoreStatus(msrest.serialization.Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - InProgress: Indicates + that blob restore is ongoing. - Complete: Indicates that blob restore has been completed + successfully. - Failed: Indicates that blob restore is failed. Possible values include: + "InProgress", "Complete", "Failed". + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceItems(msrest.serialization.Model): + """BlobServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceItems, self).__init__(**kwargs) + self.value = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the default version to use for + requests to the Blob service if an incoming request’s version is not specified. Possible values + include version 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2020_08_01_preview.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore policy. + :type restore_policy: ~azure.mgmt.storage.v2020_08_01_preview.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for container soft + delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param last_access_time_tracking_policy: The blob service property to configure last access + time based tracking policy. + :type last_access_time_tracking_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.LastAccessTimeTrackingPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'last_access_time_tracking_policy': {'key': 'properties.lastAccessTimeTrackingPolicy', 'type': 'LastAccessTimeTrackingPolicy'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + default_service_version: Optional[str] = None, + delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + is_versioning_enabled: Optional[bool] = None, + automatic_snapshot_policy_enabled: Optional[bool] = None, + change_feed: Optional["ChangeFeed"] = None, + restore_policy: Optional["RestorePolicyProperties"] = None, + container_delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + last_access_time_tracking_policy: Optional["LastAccessTimeTrackingPolicy"] = None, + **kwargs + ): + super(BlobServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + self.is_versioning_enabled = is_versioning_enabled + self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + self.change_feed = change_feed + self.restore_policy = restore_policy + self.container_delete_retention_policy = container_delete_retention_policy + self.last_access_time_tracking_policy = last_access_time_tracking_policy + + +class ChangeFeed(msrest.serialization.Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = enabled + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or is invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be used. The Reason element + is only returned if NameAvailable is false. Possible values include: "AccountNameInvalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Reason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CorsRule(msrest.serialization.Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. A list of origin + domains that will be allowed via CORS, or "*" to allow all domains. + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. A list of HTTP + methods that are allowed to be executed by the origin. + :type allowed_methods: list[str or + ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRuleAllowedMethodsItem] + :param max_age_in_seconds: Required. Required if CorsRule element is present. The number of + seconds that the client/browser should cache a preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. A list of response + headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. A list of headers + allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_origins: List[str], + allowed_methods: List[Union[str, "CorsRuleAllowedMethodsItem"]], + max_age_in_seconds: int, + exposed_headers: List[str], + allowed_headers: List[str], + **kwargs + ): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(msrest.serialization.Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the request. + + :param cors_rules: The List of CORS rules. You can include up to five CorsRule elements in the + request. + :type cors_rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__( + self, + *, + cors_rules: Optional[List["CorsRule"]] = None, + **kwargs + ): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(msrest.serialization.Model): + """The custom domain assigned to this storage account. This can be set via Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the storage account. + Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default + value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + use_sub_domain_name: Optional[bool] = None, + **kwargs + ): + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(msrest.serialization.Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the age in days after + creation. + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + *, + days_after_creation_greater_than: float, + **kwargs + ): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(msrest.serialization.Model): + """Object to define the number of days after last modification. + + :param days_after_modification_greater_than: Value indicating the age in days after last + modification. + :type days_after_modification_greater_than: float + :param days_after_last_access_time_greater_than: Value indicating the age in days after last + blob access. This property can only be used in conjunction with last access time tracking + policy. + :type days_after_last_access_time_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'minimum': 0, 'multiple': 1}, + 'days_after_last_access_time_greater_than': {'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + 'days_after_last_access_time_greater_than': {'key': 'daysAfterLastAccessTimeGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + *, + days_after_modification_greater_than: Optional[float] = None, + days_after_last_access_time_greater_than: Optional[float] = None, + **kwargs + ): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + self.days_after_last_access_time_greater_than = days_after_last_access_time_greater_than + + +class DeletedAccount(Resource): + """Deleted storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar storage_account_resource_id: Full resource id of the original storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted account via + PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedAccountListResult(msrest.serialization.Model): + """The response from the List Deleted Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of deleted accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount] + :ivar next_link: Request URL that can be used to query next page of deleted accounts. Returned + when total number of requested deleted accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DeletedShare(msrest.serialization.Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the deleted share that will + be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of the deleted share + that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + deleted_share_name: str, + deleted_share_version: str, + **kwargs + ): + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = deleted_share_name + self.deleted_share_version = deleted_share_version + + +class DeleteRetentionPolicy(msrest.serialization.Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be retained. The minimum + specified value can be 1 and the maximum value can be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + days: Optional[int] = None, + **kwargs + ): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(msrest.serialization.Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(msrest.serialization.Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible values (case- + insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: + "Microsoft.Storage", "Microsoft.Keyvault". Default value: "Microsoft.Storage". + :type key_source: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: ~azure.mgmt.storage.v2020_08_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + *, + key_source: Union[str, "KeySource"] = "Microsoft.Storage", + services: Optional["EncryptionServices"] = None, + require_infrastructure_encryption: Optional[bool] = None, + key_vault_properties: Optional["KeyVaultProperties"] = None, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.require_infrastructure_encryption = require_infrastructure_encryption + self.key_vault_properties = key_vault_properties + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param source: The provider for the encryption scope. Possible values (case-insensitive): + Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", + "Microsoft.KeyVault". + :type source: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values (case-insensitive): Enabled, + Disabled. Possible values include: "Enabled", "Disabled". + :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption scope in UTC. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modification date and time of the encryption scope in + UTC. + :vartype last_modified_time: ~datetime.datetime + :param key_vault_properties: The key vault properties for the encryption scope. This is a + required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__( + self, + *, + source: Optional[Union[str, "EncryptionScopeSource"]] = None, + state: Optional[Union[str, "EncryptionScopeState"]] = None, + key_vault_properties: Optional["EncryptionScopeKeyVaultProperties"] = None, + **kwargs + ): + super(EncryptionScope, self).__init__(**kwargs) + self.source = source + self.state = state + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = key_vault_properties + + +class EncryptionScopeKeyVaultProperties(msrest.serialization.Model): + """The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When applied, the encryption + scope will use the key referenced by the identifier to enable customer-managed key support on + this encryption scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__( + self, + *, + key_uri: Optional[str] = None, + **kwargs + ): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = key_uri + + +class EncryptionScopeListResult(msrest.serialization.Model): + """List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of encryption scopes requested. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope] + :ivar next_link: Request URL that can be used to query next page of encryption scopes. Returned + when total number of requested encryption scopes exceeds the maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EncryptionScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EncryptionService(msrest.serialization.Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts the data as it is + stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the encryption was last + enabled by the user. Only returned when encryption is enabled. There might be some unencrypted + blobs which were written after this time, as it is just a rough estimate. + :vartype last_enabled_time: ~datetime.datetime + :param key_type: Encryption key type to be used for the encryption service. 'Account' key type + implies that an account-scoped encryption key will be used. 'Service' key type implies that a + default service key is used. Possible values include: "Service", "Account". + :type key_type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_type: Optional[Union[str, "KeyType"]] = None, + **kwargs + ): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + self.key_type = key_type + + +class EncryptionServices(msrest.serialization.Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__( + self, + *, + blob: Optional["EncryptionService"] = None, + file: Optional["EncryptionService"] = None, + table: Optional["EncryptionService"] = None, + queue: Optional["EncryptionService"] = None, + **kwargs + ): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = table + self.queue = queue + + +class Endpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints. + :type internet_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__( + self, + *, + microsoft_endpoints: Optional["StorageAccountMicrosoftEndpoints"] = None, + internet_endpoints: Optional["StorageAccountInternetEndpoints"] = None, + **kwargs + ): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = microsoft_endpoints + self.internet_endpoints = internet_endpoints + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: ~azure.mgmt.storage.v2020_08_01_preview.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseBody"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class FileServiceItems(msrest.serialization.Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param share_delete_retention_policy: The file service properties for share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param protocol_settings: Protocol settings for file service. + :type protocol_settings: ~azure.mgmt.storage.v2020_08_01_preview.models.ProtocolSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'protocol_settings': {'key': 'properties.protocolSettings', 'type': 'ProtocolSettings'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + share_delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + protocol_settings: Optional["ProtocolSettings"] = None, + **kwargs + ): + super(FileServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = cors + self.share_delete_retention_policy = share_delete_retention_policy + self.protocol_settings = protocol_settings + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + share_quota: Optional[int] = None, + enabled_protocols: Optional[Union[str, "EnabledProtocols"]] = None, + root_squash: Optional[Union[str, "RootSquashType"]] = None, + access_tier: Optional[Union[str, "ShareAccessTier"]] = None, + **kwargs + ): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.snapshot_time = None + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + share_quota: Optional[int] = None, + enabled_protocols: Optional[Union[str, "EnabledProtocols"]] = None, + root_squash: Optional[Union[str, "RootSquashType"]] = None, + access_tier: Optional[Union[str, "ShareAccessTier"]] = None, + **kwargs + ): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.snapshot_time = None + + +class FileShareItems(msrest.serialization.Model): + """Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of shares. Returned when total + number of requested shares exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GeoReplicationStats(msrest.serialization.Model): + """Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when geo-redundant replication is enabled for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of the secondary location. Possible values are: - Live: Indicates that + the secondary location is active and operational. - Bootstrap: Indicates initial + synchronization from the primary location to the secondary location is in progress.This + typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: "Live", "Bootstrap", + "Unavailable". + :vartype status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time value are guaranteed to + be available for read operations. Primary writes following this point in time may or may not be + available for reads. Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: ~datetime.datetime + :ivar can_failover: A boolean flag which indicates whether or not account failover is supported + for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + *, + immutability_period_since_creation_in_days: Optional[int] = None, + allow_protected_append_writes: Optional[bool] = None, + **kwargs + ): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + + +class ImmutabilityPolicyProperties(msrest.serialization.Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob container. + :vartype update_history: + list[~azure.mgmt.storage.v2020_08_01_preview.models.UpdateHistoryProperty] + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + *, + immutability_period_since_creation_in_days: Optional[int] = None, + allow_protected_append_writes: Optional[bool] = None, + **kwargs + ): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.etag = None + self.update_history = None + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + + +class IPRule(msrest.serialization.Model): + """IP rule with specific IP or IP range in CIDR format. + + Variables are only 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 ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 + address is allowed. + :type ip_address_or_range: str + :ivar action: The action of IP ACL rule. Default value: "Allow". + :vartype action: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + 'action': {'constant': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + action = "Allow" + + def __init__( + self, + *, + ip_address_or_range: str, + **kwargs + ): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + key_version: Optional[str] = None, + key_vault_uri: Optional[str] = None, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LastAccessTimeTrackingPolicy(msrest.serialization.Model): + """The blob service properties for Last access time based tracking policy. + + All required parameters must be populated in order to send to Azure. + + :param enable: Required. When set to true last access time based tracking is enabled. + :type enable: bool + :param name: Name of the policy. The valid value is AccessTimeTracking. This field is currently + read only. Possible values include: "AccessTimeTracking". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Name + :param tracking_granularity_in_days: The field specifies blob object tracking granularity in + days, typically how often the blob object should be tracked.This field is currently read only + with value as 1. + :type tracking_granularity_in_days: int + :param blob_type: An array of predefined supported blob types. Only blockBlob is the supported + value. This field is currently read only. + :type blob_type: list[str] + """ + + _validation = { + 'enable': {'required': True}, + } + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tracking_granularity_in_days': {'key': 'trackingGranularityInDays', 'type': 'int'}, + 'blob_type': {'key': 'blobType', 'type': '[str]'}, + } + + def __init__( + self, + *, + enable: bool, + name: Optional[Union[str, "Name"]] = None, + tracking_granularity_in_days: Optional[int] = None, + blob_type: Optional[List[str]] = None, + **kwargs + ): + super(LastAccessTimeTrackingPolicy, self).__init__(**kwargs) + self.enable = enable + self.name = name + self.tracking_granularity_in_days = tracking_granularity_in_days + self.blob_type = blob_type + + +class LeaseContainerRequest(msrest.serialization.Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerRequestAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + *, + action: Union[str, "LeaseContainerRequestAction"], + lease_id: Optional[str] = None, + break_period: Optional[int] = None, + lease_duration: Optional[int] = None, + proposed_lease_id: Optional[str] = None, + **kwargs + ): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(msrest.serialization.Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + container, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + *, + lease_id: Optional[str] = None, + lease_time_seconds: Optional[str] = None, + **kwargs + ): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. A set of tags. Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__( + self, + *, + tags: List[str], + **kwargs + ): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: A set of tags. The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2020_08_01_preview.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__( + self, + *, + tags: Optional[List["TagProperty"]] = None, + **kwargs + ): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(msrest.serialization.Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListBlobInventoryPolicy(msrest.serialization.Model): + """List of blob inventory policies returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob inventory policies. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobInventoryPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListBlobInventoryPolicy, self).__init__(**kwargs) + self.value = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2020_08_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__( + self, + *, + default_encryption_scope: Optional[str] = None, + deny_encryption_scope_override: Optional[bool] = None, + public_access: Optional[Union[str, "PublicAccess"]] = None, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ListContainerItem, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(msrest.serialization.Model): + """Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blobs containers returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItem] + :ivar next_link: Request URL that can be used to query next page of containers. Returned when + total number of requested containers exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueue(Resource): + """ListQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ListQueue, self).__init__(**kwargs) + self.metadata = metadata + + +class ListQueueResource(msrest.serialization.Model): + """Response schema. Contains list of queues returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queues returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ListQueue] + :ivar next_link: Request URL that can be used to list next page of queues. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListQueue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueueServices(msrest.serialization.Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queue services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +class ListServiceSasResponse(msrest.serialization.Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_sas_token: List service SAS credentials of specific resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ListTableResource(msrest.serialization.Model): + """Response schema. Contains list of tables returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of tables returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Table] + :ivar next_link: Request URL that can be used to query next page of tables. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Table]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListTableServices(msrest.serialization.Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of table services returned. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. + :vartype last_modified_time: ~datetime.datetime + :param policy: The Storage Account ManagementPolicy, in JSON format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__( + self, + *, + policy: Optional["ManagementPolicySchema"] = None, + **kwargs + ): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(msrest.serialization.Model): + """Actions are applied to the filtered blobs when the execution condition is met. + + :param base_blob: The management policy action for base blob. + :type base_blob: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot. + :type snapshot: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__( + self, + *, + base_blob: Optional["ManagementPolicyBaseBlob"] = None, + snapshot: Optional["ManagementPolicySnapShot"] = None, + **kwargs + ): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + + +class ManagementPolicyBaseBlob(msrest.serialization.Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support blobs currently at Hot + tier. + :type tier_to_cool: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. Support blobs currently + at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param delete: The function to delete the blob. + :type delete: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param enable_auto_tier_to_hot_from_cool: This property enables auto tiering of a blob from + cool to hot on a blob access. This property requires + tierToCool.daysAfterLastAccessTimeGreaterThan. + :type enable_auto_tier_to_hot_from_cool: bool + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + 'enable_auto_tier_to_hot_from_cool': {'key': 'enableAutoTierToHotFromCool', 'type': 'bool'}, + } + + def __init__( + self, + *, + tier_to_cool: Optional["DateAfterModification"] = None, + tier_to_archive: Optional["DateAfterModification"] = None, + delete: Optional["DateAfterModification"] = None, + enable_auto_tier_to_hot_from_cool: Optional[bool] = None, + **kwargs + ): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + self.enable_auto_tier_to_hot_from_cool = enable_auto_tier_to_hot_from_cool + + +class ManagementPolicyDefinition(msrest.serialization.Model): + """An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__( + self, + *, + actions: "ManagementPolicyAction", + filters: Optional["ManagementPolicyFilter"] = None, + **kwargs + ): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(msrest.serialization.Model): + """Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only blockBlob is supported. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there can be at most 10 tag + filters. + :type blob_index_match: list[~azure.mgmt.storage.v2020_08_01_preview.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__( + self, + *, + blob_types: List[str], + prefix_match: Optional[List[str]] = None, + blob_index_match: Optional[List["TagFilter"]] = None, + **kwargs + ): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + self.blob_index_match = blob_index_match + + +class ManagementPolicyRule(msrest.serialization.Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param type: Required. The valid value is Lifecycle. Possible values include: "Lifecycle". + :type type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RuleType + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "RuleType"], + definition: "ManagementPolicyDefinition", + enabled: Optional[bool] = None, + **kwargs + ): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.type = type + self.definition = definition + + +class ManagementPolicySchema(msrest.serialization.Model): + """The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__( + self, + *, + rules: List["ManagementPolicyRule"], + **kwargs + ): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(msrest.serialization.Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot. + :type delete: ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + *, + delete: Optional["DateAfterCreation"] = None, + **kwargs + ): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = delete + + +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access tier. + :type dimensions: list[~azure.mgmt.storage.v2020_08_01_preview.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + aggregation_type: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class Multichannel(msrest.serialization.Model): + """Multichannel setting. Applies to Premium FileStorage only. + + :param enabled: Indicates whether multichannel is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(Multichannel, self).__init__(**kwargs) + self.enabled = enabled + + +class NetworkRuleSet(msrest.serialization.Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, + Metrics"), or None to bypass none of those traffics. Possible values include: "None", + "Logging", "Metrics", "AzureServices". Default value: "AzureServices". + :type bypass: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Bypass + :param resource_access_rules: + :type resource_access_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules. + :type ip_rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.IPRule] + :param default_action: Required. Specifies the default action of allow or deny when no other + rules match. Possible values include: "Allow", "Deny". Default value: "Allow". + :type default_action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + } + + def __init__( + self, + *, + default_action: Union[str, "DefaultAction"] = "Allow", + bypass: Optional[Union[str, "Bypass"]] = "AzureServices", + resource_access_rules: Optional[List["ResourceAccessRule"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + ip_rules: Optional[List["IPRule"]] = None, + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.resource_access_rules = resource_access_rules + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class ObjectReplicationPolicies(msrest.serialization.Model): + """List storage account object replication policies. + + :param value: The replication policy between two storage accounts. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ObjectReplicationPolicy]'}, + } + + def __init__( + self, + *, + value: Optional[List["ObjectReplicationPolicy"]] = None, + **kwargs + ): + super(ObjectReplicationPolicies, self).__init__(**kwargs) + self.value = value + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be defined in one policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source account. + :vartype enabled_time: ~datetime.datetime + :param source_account: Required. Source account name. + :type source_account: str + :param destination_account: Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__( + self, + *, + source_account: Optional[str] = None, + destination_account: Optional[str] = None, + rules: Optional[List["ObjectReplicationPolicyRule"]] = None, + **kwargs + ): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = source_account + self.destination_account = destination_account + self.rules = rules + + +class ObjectReplicationPolicyFilter(msrest.serialization.Model): + """Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs whose names begin + with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated to the destination. + It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__( + self, + *, + prefix_match: Optional[List[str]] = None, + min_creation_time: Optional[str] = None, + **kwargs + ): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.min_creation_time = min_creation_time + + +class ObjectReplicationPolicyRule(msrest.serialization.Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination account. It is + required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__( + self, + *, + source_container: str, + destination_container: str, + rule_id: Optional[str] = None, + filters: Optional["ObjectReplicationPolicyFilter"] = None, + **kwargs + ): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.source_container = source_container + self.destination_container = destination_container + self.filters = filters + + +class Operation(msrest.serialization.Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2020_08_01_preview.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: + ~azure.mgmt.storage.v2020_08_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :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, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource provider. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + action_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + +class ProtocolSettings(msrest.serialization.Model): + """Protocol settings for file service. + + :param smb: Setting for SMB protocol. + :type smb: ~azure.mgmt.storage.v2020_08_01_preview.models.SmbSetting + """ + + _attribute_map = { + 'smb': {'key': 'smb', 'type': 'SmbSetting'}, + } + + def __init__( + self, + *, + smb: Optional["SmbSetting"] = None, + **kwargs + ): + super(ProtocolSettings, self).__init__(**kwargs) + self.smb = smb + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + **kwargs + ): + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class ResourceAccessRule(msrest.serialization.Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id. + :type tenant_id: str + :param resource_id: Resource Id. + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + tenant_id: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.resource_id = resource_id + + +class RestorePolicyProperties(msrest.serialization.Model): + """The blob service properties for blob restore policy. + + Variables are only 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 enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than zero and less than + DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: ~datetime.datetime + :ivar min_restore_time: Returns the minimum date and time that the restore can be started. + :vartype min_restore_time: ~datetime.datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + enabled: bool, + days: Optional[int] = None, + **kwargs + ): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + self.last_enabled_time = None + self.min_restore_time = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. Possible values include: "QuotaId", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + *, + reason_code: Optional[Union[str, "ReasonCode"]] = None, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class RoutingPreference(msrest.serialization.Model): + """Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, the default option is microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing opted by the user. + Possible values include: "MicrosoftRouting", "InternetRouting". + :type routing_choice: str or ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether microsoft routing + storage endpoints are to be published. + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether internet routing + storage endpoints are to be published. + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + *, + routing_choice: Optional[Union[str, "RoutingChoice"]] = None, + publish_microsoft_endpoints: Optional[bool] = None, + publish_internet_endpoints: Optional[bool] = None, + **kwargs + ): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = routing_choice + self.publish_microsoft_endpoints = publish_microsoft_endpoints + self.publish_internet_endpoints = publish_internet_endpoints + + +class ServiceSasParameters(msrest.serialization.Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. Possible values include: + Blob (b), Container (c), File (f), Share (s). Possible values include: "b", "c", "f", "s". + :type resource: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible values include: Read + (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible + values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2020_08_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: The time at which the shared access signature becomes + invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param identifier: A unique value up to 64 characters in length that correlates to an access + policy specified for the container, queue, or table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content disposition. + :type content_disposition: str + :param content_encoding: The response header override for content encoding. + :type content_encoding: str + :param content_language: The response header override for content language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64, 'min_length': 0}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__( + self, + *, + canonicalized_resource: str, + resource: Optional[Union[str, "SignedResource"]] = None, + permissions: Optional[Union[str, "Permissions"]] = None, + ip_address_or_range: Optional[str] = None, + protocols: Optional[Union[str, "HttpProtocol"]] = None, + shared_access_start_time: Optional[datetime.datetime] = None, + shared_access_expiry_time: Optional[datetime.datetime] = None, + identifier: Optional[str] = None, + partition_key_start: Optional[str] = None, + partition_key_end: Optional[str] = None, + row_key_start: Optional[str] = None, + row_key_end: Optional[str] = None, + key_to_sign: Optional[str] = None, + cache_control: Optional[str] = None, + content_disposition: Optional[str] = None, + content_encoding: Optional[str] = None, + content_language: Optional[str] = None, + content_type: Optional[str] = None, + **kwargs + ): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2020_08_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(msrest.serialization.Model): + """The SKU of the storage account. + + Variables are only 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 name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class SKUCapability(msrest.serialization.Model): + """The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of capability, The capability information in the specified SKU, including + file encryption, network ACLs, change notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(msrest.serialization.Model): + """Storage SKU and its properties. + + Variables are only 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 name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + :ivar resource_type: The type of the resource, usually it is 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values include: "Storage", + "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + :vartype capabilities: list[~azure.mgmt.storage.v2020_08_01_preview.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.storage.v2020_08_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + restrictions: Optional[List["Restriction"]] = None, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SmbSetting(msrest.serialization.Model): + """Setting for SMB protocol. + + :param multichannel: Multichannel setting. Applies to Premium FileStorage only. + :type multichannel: ~azure.mgmt.storage.v2020_08_01_preview.models.Multichannel + """ + + _attribute_map = { + 'multichannel': {'key': 'multichannel', 'type': 'Multichannel'}, + } + + def __init__( + self, + *, + multichannel: Optional["Multichannel"] = None, + **kwargs + ): + super(SmbSetting, self).__init__(**kwargs) + self.multichannel = multichannel + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocation + :ivar provisioning_state: Gets the status of the storage account at the time the operation was + called. Possible values include: "Creating", "ResolvingDNS", "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob + endpoint. + :vartype primary_endpoints: ~azure.mgmt.storage.v2020_08_01_preview.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary location of the storage + account is available or unavailable. Possible values include: "available", "unavailable". + :vartype status_of_primary: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent instance of a failover to + the secondary location. Only the most recent timestamp is retained. This element is not + returned if there has never been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: ~datetime.datetime + :ivar secondary_location: Gets the location of the geo-replicated secondary for the storage + account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the secondary location of the + storage account is available or unavailable. Only available if the SKU name is Standard_GRS or + Standard_RAGRS. Possible values include: "available", "unavailable". + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage account in UTC. + :vartype creation_time: ~datetime.datetime + :ivar custom_domain: Gets the custom domain the user assigned to this storage account. + :vartype custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object from the secondary location of the storage account. Only available if + the SKU name is Standard_RAGRS. + :vartype secondary_endpoints: ~azure.mgmt.storage.v2020_08_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If unspecified, the account is + unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. The access tier used + for billing. Possible values include: "Hot", "Cool". + :vartype access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set. + :vartype network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats. + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will be true, otherwise, + it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection associated with the + specified storage account. + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :ivar blob_restore_status: Blob restore status. + :vartype blob_restore_status: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'str'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + extended_location: Optional["ExtendedLocation"] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + is_hns_enabled: Optional[bool] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + **kwargs + ): + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.extended_location = extended_location + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = large_file_shares_state + self.private_endpoint_connections = None + self.routing_preference = routing_preference + self.blob_restore_status = None + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + + +class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): + """The parameters used to check the availability of the storage account name. + + Variables are only 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 name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(msrest.serialization.Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param kind: Required. Required. Indicates the type of storage account. Possible values + include: "Storage", "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param location: Required. Required. Gets or sets the location of the resource. This will be + one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + etc.). The geo region of a resource cannot be changed once it is created, but if an identical + geo region is specified on update, the request will succeed. + :type location: str + :param extended_location: Optional. Set the extended location of the resource. If not set, the + storage account will be created in Azure main region. Otherwise it will be created in the + specified extended location. + :type extended_location: ~azure.mgmt.storage.v2020_08_01_preview.models.ExtendedLocation + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used for viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no + greater than 128 characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is the CNAME source. + Only one custom domain is supported per storage account at this time. To clear the existing + custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for all storage accounts + and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + The default value is true since API version 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + sku: "Sku", + kind: Union[str, "Kind"], + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + custom_domain: Optional["CustomDomain"] = None, + encryption: Optional["Encryption"] = None, + network_rule_set: Optional["NetworkRuleSet"] = None, + access_tier: Optional[Union[str, "AccessTier"]] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + is_hns_enabled: Optional[bool] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + **kwargs + ): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.extended_location = extended_location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + + +class StorageAccountInternetEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(msrest.serialization.Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full permissions. Possible values + include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.storage.v2020_08_01_preview.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(msrest.serialization.Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for the specified + storage account. + :vartype keys: list[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountListResult(msrest.serialization.Model): + """The response from the List Storage Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of storage accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :ivar next_link: Request URL that can be used to query next page of storage accounts. Returned + when total number of requested storage accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountMicrosoftEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(msrest.serialization.Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be regenerated, possible + values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: str, + **kwargs + ): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating the storage account properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be updated to + Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any + other value. + :type sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in + length than 128 characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.models.Identity + :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value + supported by server. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param custom_domain: Custom domain assigned to the storage account by the user. Name is the + CNAME source. Only one custom domain is supported per storage account at this time. To clear + the existing custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2020_08_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The default setting is + unencrypted. + :type encryption: ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2020_08_01_preview.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + sku: Optional["Sku"] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + kind: Optional[Union[str, "Kind"]] = None, + custom_domain: Optional["CustomDomain"] = None, + encryption: Optional["Encryption"] = None, + access_tier: Optional[Union[str, "AccessTier"]] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + network_rule_set: Optional["NetworkRuleSet"] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + **kwargs + ): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.kind = kind + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + + +class StorageQueue(Resource): + """StorageQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number of messages in the + queue. This number is not lower than the actual number of messages in the queue, but could be + higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StorageQueue, self).__init__(**kwargs) + self.metadata = metadata + self.approximate_message_count = None + + +class StorageSkuListResult(msrest.serialization.Model): + """The response from the List Storage SKUs operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Get the list result of storage SKUs and their properties. + :vartype value: list[~azure.mgmt.storage.v2020_08_01_preview.models.SkuInformation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSkuListResult, self).__init__(**kwargs) + self.value = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.storage.v2020_08_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _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, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar table_name: Table name under the specified account. + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + **kwargs + ): + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class TagFilter(msrest.serialization.Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 characters. + :type name: str + :param op: Required. This is the comparison operator which is used for object comparison and + filtering. Only == (equality operator) is currently supported. + :type op: str + :param value: Required. This is the filter tag value field used for tag based filtering, it can + have 0 - 256 characters. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + op: str, + value: str, + **kwargs + ): + super(TagFilter, self).__init__(**kwargs) + self.name = name + self.op = op + self.value = value + + +class TagProperty(msrest.serialization.Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who added the tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(msrest.serialization.Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, possible values include: + put, lock and extend. Possible values include: "put", "lock", "extend". + :vartype update: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was updated. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who updated the ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who updated the + ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(msrest.serialization.Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountsPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.storage.v2020_08_01_preview.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2020_08_01_preview.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageListResult(msrest.serialization.Model): + """The response from the List Usages operation. + + :param value: Gets or sets the list of Storage Resource Usages. + :type value: list[~azure.mgmt.storage.v2020_08_01_preview.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + *, + value: Optional[List["Usage"]] = None, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = value + + +class UsageName(msrest.serialization.Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(msrest.serialization.Model): + """Virtual Network rule. + + Variables are only 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 virtual_network_resource_id: Required. Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :ivar action: The action of virtual network rule. Default value: "Allow". + :vartype action: str + :param state: Gets the state of virtual network rule. Possible values include: "provisioning", + "deprovisioning", "succeeded", "failed", "networkSourceDeleted". + :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + 'action': {'constant': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + action = "Allow" + + def __init__( + self, + *, + virtual_network_resource_id: str, + state: Optional[Union[str, "State"]] = None, + **kwargs + ): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py new file mode 100644 index 0000000000000..80c516d5a23e4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py @@ -0,0 +1,448 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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, 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 AccessTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Required for storage accounts where kind = BlobStorage. The access tier used for billing. + """ + + HOT = "Hot" + COOL = "Cool" + +class AccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the status indicating whether the primary location of the storage account is available or + unavailable. + """ + + AVAILABLE = "available" + UNAVAILABLE = "unavailable" + +class BlobInventoryPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "default" + +class BlobRestoreProgressStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of blob restore progress. Possible values are: - InProgress: Indicates that blob + restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - + Failed: Indicates that blob restore is failed. + """ + + IN_PROGRESS = "InProgress" + COMPLETE = "Complete" + FAILED = "Failed" + +class Bypass(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are + any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to + bypass none of those traffics. + """ + + NONE = "None" + LOGGING = "Logging" + METRICS = "Metrics" + AZURE_SERVICES = "AzureServices" + +class CorsRuleAllowedMethodsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DELETE = "DELETE" + GET = "GET" + HEAD = "HEAD" + MERGE = "MERGE" + POST = "POST" + OPTIONS = "OPTIONS" + PUT = "PUT" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the default action of allow or deny when no other rules match. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class DirectoryServiceOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the directory service used. + """ + + NONE = "None" + AADDS = "AADDS" + AD = "AD" + +class EnabledProtocols(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication protocol that is used for the file share. Can only be specified when + creating a share. + """ + + SMB = "SMB" + NFS = "NFS" + +class EncryptionScopeSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, + Microsoft.KeyVault. + """ + + MICROSOFT_STORAGE = "Microsoft.Storage" + MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" + +class EncryptionScopeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class GeoReplicationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the secondary location. Possible values are: - Live: Indicates that the secondary + location is active and operational. - Bootstrap: Indicates initial synchronization from the + primary location to the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary location is + temporarily unavailable. + """ + + LIVE = "Live" + BOOTSTRAP = "Bootstrap" + UNAVAILABLE = "Unavailable" + +class HttpProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol permitted for a request made with the account SAS. + """ + + HTTPS_HTTP = "https,http" + HTTPS = "https" + +class ImmutabilityPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + """ + + LOCKED = "Locked" + UNLOCKED = "Unlocked" + +class ImmutabilityPolicyUpdateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and + extend. + """ + + PUT = "put" + LOCK = "lock" + EXTEND = "extend" + +class InventoryRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The valid value is Inventory + """ + + INVENTORY = "Inventory" + +class KeyPermission(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Permissions for the key -- read-only or full permissions. + """ + + READ = "Read" + FULL = "Full" + +class KeySource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, + Microsoft.Keyvault + """ + + MICROSOFT_STORAGE = "Microsoft.Storage" + MICROSOFT_KEYVAULT = "Microsoft.Keyvault" + +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Encryption key type to be used for the encryption service. 'Account' key type implies that an + account-scoped encryption key will be used. 'Service' key type implies that a default service + key is used. + """ + + SERVICE = "Service" + ACCOUNT = "Account" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of storage account. + """ + + STORAGE = "Storage" + STORAGE_V2 = "StorageV2" + BLOB_STORAGE = "BlobStorage" + FILE_STORAGE = "FileStorage" + BLOCK_BLOB_STORAGE = "BlockBlobStorage" + +class LargeFileSharesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class LeaseContainerRequestAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the lease action. Can be one of the available actions. + """ + + ACQUIRE = "Acquire" + RENEW = "Renew" + CHANGE = "Change" + RELEASE = "Release" + BREAK_ENUM = "Break" + +class LeaseDuration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether the lease on a container is of infinite or fixed duration, only when the + container is leased. + """ + + INFINITE = "Infinite" + FIXED = "Fixed" + +class LeaseState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Lease state of the container. + """ + + AVAILABLE = "Available" + LEASED = "Leased" + EXPIRED = "Expired" + BREAKING = "Breaking" + BROKEN = "Broken" + +class LeaseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The lease status of the container. + """ + + LOCKED = "Locked" + UNLOCKED = "Unlocked" + +class ListContainersInclude(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DELETED = "deleted" + +class ListSharesExpand(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DELETED = "deleted" + SNAPSHOTS = "snapshots" + +class ManagementPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "default" + +class MinimumTlsVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Set the minimum TLS version to be permitted on requests to storage. The default interpretation + is TLS 1.0 for this property. + """ + + TLS1_0 = "TLS1_0" + TLS1_1 = "TLS1_1" + TLS1_2 = "TLS1_2" + +class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + """ + + ACCESS_TIME_TRACKING = "AccessTimeTracking" + +class Permissions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed permissions for the account SAS. Possible values include: Read (r), Write (w), + Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + """ + + R = "r" + D = "d" + W = "w" + L = "l" + A = "a" + C = "c" + U = "u" + P = "p" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the status of the storage account at the time the operation was called. + """ + + CREATING = "Creating" + RESOLVING_DNS = "ResolvingDNS" + SUCCEEDED = "Succeeded" + +class PublicAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether data in the container may be accessed publicly and the level of access. + """ + + CONTAINER = "Container" + BLOB = "Blob" + NONE = "None" + +class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the reason that a storage account name could not be used. The Reason element is only + returned if NameAvailable is false. + """ + + ACCOUNT_NAME_INVALID = "AccountNameInvalid" + ALREADY_EXISTS = "AlreadyExists" + +class ReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +class RootSquashType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The property is for NFS share only. The default is NoRootSquash. + """ + + NO_ROOT_SQUASH = "NoRootSquash" + ROOT_SQUASH = "RootSquash" + ALL_SQUASH = "AllSquash" + +class RoutingChoice(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Routing Choice defines the kind of network routing opted by the user. + """ + + MICROSOFT_ROUTING = "MicrosoftRouting" + INTERNET_ROUTING = "InternetRouting" + +class RuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The valid value is Lifecycle + """ + + LIFECYCLE = "Lifecycle" + +class Services(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed services accessible with the account SAS. Possible values include: Blob (b), Queue + (q), Table (t), File (f). + """ + + B = "b" + Q = "q" + T = "t" + F = "f" + +class ShareAccessTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), + Hot, and Cool. FileStorage account can choose Premium. + """ + + TRANSACTION_OPTIMIZED = "TransactionOptimized" + HOT = "Hot" + COOL = "Cool" + PREMIUM = "Premium" + +class SignedResource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed services accessible with the service SAS. Possible values include: Blob (b), + Container (c), File (f), Share (s). + """ + + B = "b" + C = "c" + F = "f" + S = "s" + +class SignedResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed resource types that are accessible with the account SAS. Service (s): Access to + service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + """ + + S = "s" + C = "c" + O = "o" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU name. Required for account creation; optional for update. Note that in older versions, + SKU name was called accountType. + """ + + STANDARD_LRS = "Standard_LRS" + STANDARD_GRS = "Standard_GRS" + STANDARD_RAGRS = "Standard_RAGRS" + STANDARD_ZRS = "Standard_ZRS" + PREMIUM_LRS = "Premium_LRS" + PREMIUM_ZRS = "Premium_ZRS" + STANDARD_GZRS = "Standard_GZRS" + STANDARD_RAGZRS = "Standard_RAGZRS" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU tier. This is based on the SKU name. + """ + + STANDARD = "Standard" + PREMIUM = "Premium" + +class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the state of virtual network rule. + """ + + PROVISIONING = "provisioning" + DEPROVISIONING = "deprovisioning" + SUCCEEDED = "succeeded" + FAILED = "failed" + NETWORK_SOURCE_DELETED = "networkSourceDeleted" + +class StorageAccountExpand(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + GEO_REPLICATION_STATS = "geoReplicationStats" + BLOB_RESTORE_STATUS = "blobRestoreStatus" + +class UsageUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the unit of measurement. + """ + + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + PERCENT = "Percent" + COUNTS_PER_SECOND = "CountsPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py new file mode 100644 index 0000000000000..bddcf8c8cb348 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_inventory_policies_operations import BlobInventoryPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations +from ._queue_services_operations import QueueServicesOperations +from ._queue_operations import QueueOperations +from ._table_services_operations import TableServicesOperations +from ._table_operations import TableOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'DeletedAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'BlobInventoryPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', + 'QueueServicesOperations', + 'QueueOperations', + 'TableServicesOperations', + 'TableOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py new file mode 100644 index 0000000000000..0ccc3d38b7cbf --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py @@ -0,0 +1,1099 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +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]] + +class BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + include=None, # type: Optional[Union[str, "_models.ListContainersInclude"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListContainerItems"] + """Lists all containers and does not support a prefix like data plane. Also SRP today does not + return continuation token. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of containers that can be included in + the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting with the filter will be + listed. + :type filter: str + :param include: Optional, used to include the properties for soft deleted blob containers. + :type include: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ListContainersInclude + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListContainerItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListContainerItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + blob_container, # type: "_models.BlobContainer" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Creates a new container under the specified account as described by request body. The container + resource includes metadata and properties for that container. It does not include a list of the + blobs contained by the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties of the blob container to create. + :type blob_container: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + blob_container, # type: "_models.BlobContainer" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Updates container properties as specified in request body. Properties not mentioned in the + request will be unchanged. Update fails if the specified container doesn't already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties to update for the blob container. + :type blob_container: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Gets properties of a specified container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def set_legal_hold( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + legal_hold, # type: "_models.LegalHold" + **kwargs # type: Any + ): + # type: (...) -> "_models.LegalHold" + """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold + follows an append pattern and does not clear out the existing tags that are not specified in + the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be set to a blob container. + :type legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} # type: ignore + + def clear_legal_hold( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + legal_hold, # type: "_models.LegalHold" + **kwargs # type: Any + ): + # type: (...) -> "_models.LegalHold" + """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent + operation. ClearLegalHold clears out only the specified tags in the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be clear from a blob container. + :type legal_hold: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.clear_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} # type: ignore + + def create_or_update_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match=None, # type: Optional[str] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but + not required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob + container. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def get_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Gets the existing immutability policy along with the corresponding ETag in response headers and + body. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def delete_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this + operation. Deleting a locked immutability policy is not allowed, the only way is to delete the + container after deleting all expired blobs inside the policy locked container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def lock_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.lock_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(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) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} # type: ignore + + def extend_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only + action allowed on a Locked policy will be this action. ETag in If-Match is required for this + operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob + container. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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['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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} # type: ignore + + def lease( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + parameters=None, # type: Optional["_models.LeaseContainerRequest"] + **kwargs # type: Any + ): + # type: (...) -> "_models.LeaseContainerResponse" + """The Lease Container operation establishes and manages a lock on a container for delete + operations. The lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseContainerResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LeaseContainerResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_inventory_policies_operations.py new file mode 100644 index 0000000000000..3d8b22ea0435d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_inventory_policies_operations.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +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]] + +class BlobInventoryPoliciesOperations(object): + """BlobInventoryPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobInventoryPolicy" + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + properties, # type: "_models.BlobInventoryPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobInventoryPolicy" + """Sets the blob inventory policy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :param properties: The blob inventory policy set to a storage account. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # 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(properties, 'BlobInventoryPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListBlobInventoryPolicy"] + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListBlobInventoryPolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListBlobInventoryPolicy] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListBlobInventoryPolicy', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py new file mode 100644 index 0000000000000..0ea3f4d06b706 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py @@ -0,0 +1,263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BlobServiceItems"] + """List blob services of storage account. It returns a collection of one object named default. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BlobServiceItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BlobServiceItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobServiceProperties" + """Sets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, including properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + blob_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_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') + + # 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(parameters, 'BlobServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobServiceProperties" + """Gets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + blob_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py new file mode 100644 index 0000000000000..8f6ea04475a4e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeletedAccountsOperations(object): + """DeletedAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedAccountListResult"] + """Lists deleted accounts under the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'} # type: ignore + + def get( + self, + deleted_account_name, # type: str + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedAccount" + """Get properties of specified deleted account resource. + + :param deleted_account_name: Name of the deleted storage account. + :type deleted_account_name: str + :param location: The location of the deleted storage account. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedAccountName': self._serialize.url("deleted_account_name", deleted_account_name, 'str', max_length=24, min_length=3), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py new file mode 100644 index 0000000000000..ce8154f702f72 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py @@ -0,0 +1,357 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +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]] + +class EncryptionScopesOperations(object): + """EncryptionScopesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def put( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + encryption_scope, # type: "_models.EncryptionScope" + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Synchronously creates or updates an encryption scope under the specified storage account. If an + encryption scope is already created and a subsequent request is issued with different + properties, the encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the create or update. + :type encryption_scope: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + 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(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def patch( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + encryption_scope, # type: "_models.EncryptionScope" + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Update encryption scope properties as specified in the request body. Update fails if the + specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the update. + :type encryption_scope: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + 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(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EncryptionScopeListResult"] + """Lists all the encryption scopes available under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EncryptionScopeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EncryptionScopeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py new file mode 100644 index 0000000000000..ae469267a49a5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py @@ -0,0 +1,246 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FileServicesOperations(object): + """FileServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceItems" + """List all file services in storage accounts. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceItems, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceItems + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('FileServiceItems', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.FileServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceProperties" + """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of file services in storage accounts, including CORS (Cross- + Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + file_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_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') + + # 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(parameters, 'FileServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceProperties" + """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + file_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py new file mode 100644 index 0000000000000..f22d0044b997d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py @@ -0,0 +1,531 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +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]] + +class FileSharesOperations(object): + """FileSharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + expand=None, # type: Optional[Union[str, "_models.ListSharesExpand"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FileShareItems"] + """Lists all shares. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of shares that can be included in the + list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting with the filter will be + listed. + :type filter: str + :param expand: Optional, used to expand the properties within share's properties. + :type expand: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ListSharesExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FileShareItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FileShareItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + file_share, # type: "_models.FileShare" + expand="snapshots", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Creates a new share under the specified account as described by request body. The share + resource includes metadata and properties for that share. It does not include a list of the + files contained by the share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties of the file share to create. + :type file_share: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :param expand: Optional, used to create a snapshot. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FileShare', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + file_share, # type: "_models.FileShare" + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Updates share properties as specified in request body. Properties not mentioned in the request + will not be changed. Update fails if the specified share does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties to update for the file share. + :type file_share: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + expand="stats", # type: Optional[str] + x_ms_snapshot=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Gets properties of a specified share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param expand: Optional, used to expand the properties within share's properties. + :type expand: str + :param x_ms_snapshot: Optional, used to retrieve properties of a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + x_ms_snapshot=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes specified share under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional, used to delete a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def restore( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + deleted_share, # type: "_models.DeletedShare" + **kwargs # type: Any + ): + # type: (...) -> None + """Restore a file share within a valid retention days if share soft delete is enabled. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param deleted_share: + :type deleted_share: ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.restore.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(deleted_share, 'DeletedShare') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py new file mode 100644 index 0000000000000..69a5f612499ca --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ManagementPoliciesOperations(object): + """ManagementPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagementPolicy" + """Gets the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagementPolicy" + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :param properties: The ManagementPolicy set to a storage account. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # 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(properties, 'ManagementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py new file mode 100644 index 0000000000000..7a5d09c5c43c8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py @@ -0,0 +1,335 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ObjectReplicationPoliciesOperations(object): + """ObjectReplicationPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ObjectReplicationPolicies"] + """List the object replication policies associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ObjectReplicationPolicies or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ObjectReplicationPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectReplicationPolicy" + """Get the object replication policy of the storage account by policy ID. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + properties, # type: "_models.ObjectReplicationPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectReplicationPolicy" + """Create or update the object replication policy of the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage account. A unique policy ID + will be created if absent. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + 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(properties, 'ObjectReplicationPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the object replication policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication policy or 'default' if the + policy ID is unknown. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py new file mode 100644 index 0000000000000..01b0b2fe61316 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available Storage Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..999092904cc44 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """List all the private endpoint connections associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def put( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + properties, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # 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(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..8b4dd854c392b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourceListResult" + """Gets the private link resources that need to be created for a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py new file mode 100644 index 0000000000000..8d161e1064bff --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py @@ -0,0 +1,425 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QueueOperations(object): + """QueueOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + queue, # type: "_models.StorageQueue" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + 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(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + queue, # type: "_models.StorageQueue" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + 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(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Gets the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListQueueResource"] + """Gets a list of all the queues under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param maxpagesize: Optional, a maximum number of queues that should be included in a list + queue response. + :type maxpagesize: str + :param filter: Optional, When specified, only the queues with a name starting with the given + filter will be listed. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListQueueResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListQueueResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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 maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListQueueResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py new file mode 100644 index 0000000000000..66fc2bea5e517 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py @@ -0,0 +1,246 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QueueServicesOperations(object): + """QueueServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ListQueueServices" + """List all queue services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListQueueServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListQueueServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('ListQueueServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.QueueServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.QueueServiceProperties" + """Sets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Queue service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + queue_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_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') + + # 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(parameters, 'QueueServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.QueueServiceProperties" + """Gets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + queue_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py new file mode 100644 index 0000000000000..42f8fbad937a4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SkusOperations(object): + """SkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageSkuListResult"] + """Lists the available SKUs supported by Microsoft.Storage for given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageSkuListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py new file mode 100644 index 0000000000000..f1782b5b35794 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py @@ -0,0 +1,1171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +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]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResult" + """Checks that the storage account name is valid and is not already in use. + + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'StorageAccountCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Asynchronously creates a new storage account with the specified parameters. If an account is + already created and a subsequent create request is issued with different properties, the + account properties will be updated. If an account is already created and a subsequent create or + update request is issued with the exact same set of properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def get_properties( + self, + resource_group_name, # type: str + account_name, # type: str + expand=None, # type: Optional[Union[str, "_models.StorageAccountExpand"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccount" + """Returns the properties for the specified storage account including but not limited to name, SKU + name, location, and account status. The ListKeys operation should be used to retrieve storage + keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's properties. By default, + data is not included when fetching properties. Currently we only support geoReplicationStats + and blobRestoreStatus. + :type expand: str or ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccount" + """The update operation can be used to update the SKU, encryption, access tier, or tags for a + storage account. It can also be used to map the account to a custom domain. Only one custom + domain is supported per storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must be cleared/unregistered + before a new value can be set. The update of multiple properties is supported. This call does + not change the storage keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage account cannot be + changed after creation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'StorageAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountListResult"] + """Lists all the storage accounts available under the subscription. Note that storage keys are not + returned; use the ListKeys operation for this. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountListResult"] + """Lists all the storage accounts available under the given resource group. Note that storage keys + are not returned; use the ListKeys operation for this. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + expand="kerb", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccountListKeysResult" + """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage + account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value is kerb. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(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('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} # type: ignore + + def regenerate_key( + self, + resource_group_name, # type: str + account_name, # type: str + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccountListKeysResult" + """Regenerates one of the access keys or Kerberos keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param regenerate_key: Specifies name of the key which should be regenerated -- key1, key2, + kerb1, kerb2. + :type regenerate_key: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountRegenerateKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} # type: ignore + + def list_account_sas( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.AccountSasParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ListAccountSasResponse" + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials for the storage account. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.AccountSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListAccountSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListAccountSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_account_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'AccountSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListAccountSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} # type: ignore + + def list_service_sas( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.ServiceSasParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ListServiceSasResponse" + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS credentials. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.ServiceSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListServiceSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListServiceSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_service_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'ServiceSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListServiceSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} # type: ignore + + def _failover_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self._failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + request = self._client.post(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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + def begin_failover( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Failover request can be triggered for a storage account in case of availability issues. The + failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + accounts. The secondary cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + def _restore_blob_ranges_initial( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobRestoreParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobRestoreStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_blob_ranges_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(parameters, 'BlobRestoreParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _restore_blob_ranges_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + def begin_restore_blob_ranges( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobRestoreParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BlobRestoreStatus"] + """Restore blobs in the specified blob ranges. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The parameters to provide for restore blob ranges. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + 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._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + def revoke_user_delegation_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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] + + request = self._client.post(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) + + if cls: + return cls(pipeline_response, None, {}) + + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py new file mode 100644 index 0000000000000..65e0966b2a419 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py @@ -0,0 +1,393 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TableOperations(object): + """TableOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.patch(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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Gets the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListTableResource"] + """Gets a list of all the tables under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListTableResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListTableResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListTableResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py new file mode 100644 index 0000000000000..01d5954ffe066 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py @@ -0,0 +1,246 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TableServicesOperations(object): + """TableServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ListTableServices" + """List all table services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListTableServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.ListTableServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.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('ListTableServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.TableServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.TableServiceProperties" + """Sets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Table service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + table_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_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') + + # 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(parameters, 'TableServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TableServiceProperties" + """Gets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and lower- + case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + table_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py new file mode 100644 index 0000000000000..7e57fa403c88c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2020_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageListResult"] + """Gets the current usage count and the limit for the resources of the location under the + subscription. + + :param location: The location of the Azure Storage resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.UsageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/py.typed b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file