From 05e43c06d7b6deab3d438f8c9e56c10200b598c4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 11 Mar 2021 04:38:54 +0000 Subject: [PATCH] CodeGen from PR 13333 in Azure/azure-rest-api-specs Merge 7edd466b7e24db9ee6dc1752627d8d10752a1c65 into ff541d84da3e56318de42e92222e9501a9ccb632 --- .../operations/_blob_containers_operations.py | 123 +++++++++++++++++ .../storage/v2021_01_01/models/__init__.py | 2 + .../storage/v2021_01_01/models/_models.py | 32 +++++ .../storage/v2021_01_01/models/_models_py3.py | 34 +++++ .../_storage_management_client_enums.py | 8 ++ .../operations/_blob_containers_operations.py | 125 ++++++++++++++++++ 6 files changed, 324 insertions(+) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py index 2e647f181408..8490b450d66c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py @@ -12,7 +12,9 @@ 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 @@ -1080,3 +1082,124 @@ async def lease( return deserialized lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore + + async def _version_level_worm_initial( + self, + resource_group_name: str, + account_name: str, + container_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 = "2021-01-01" + + # Construct URL + url = self._version_level_worm_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), + '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.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, 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, {}) + + _version_level_worm_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore + + async def begin_version_level_worm( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """This operation migrates a blob container from container level WORM to version level WORM + enabled container. Prerequisites require a container level immutability policy either in locked + or unlocked state, Account level versioning must be enabled and there should be no Legal holds. + + :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 + :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._version_level_worm_initial( + resource_group_name=resource_group_name, + account_name=account_name, + container_name=container_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), + '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), + } + + 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_version_level_worm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/__init__.py index 46749abf487c..75a6d0211acc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/__init__.py @@ -297,6 +297,7 @@ ListContainersInclude, ListSharesExpand, ManagementPolicyName, + MigrationState, MinimumTlsVersion, Name, Permissions, @@ -481,6 +482,7 @@ 'ListContainersInclude', 'ListSharesExpand', 'ManagementPolicyName', + 'MigrationState', 'MinimumTlsVersion', 'Name', 'Permissions', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py index e3b8123185e6..c331514ba9f4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py @@ -293,6 +293,14 @@ class BlobContainer(AzureEntityResource): 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 + :param enabled: This is an immutable property, when set to true enables version level worm at + the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the version level worm was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level worm to version level worm + migration state. Possible values include: "InProgress", "Completed", "Abort". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_01_01.models.MigrationState """ _validation = { @@ -312,6 +320,8 @@ class BlobContainer(AzureEntityResource): 'legal_hold': {'readonly': True}, 'has_legal_hold': {'readonly': True}, 'has_immutability_policy': {'readonly': True}, + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, } _attribute_map = { @@ -335,6 +345,9 @@ class BlobContainer(AzureEntityResource): 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'enabled': {'key': 'properties.versionLevelWorm.enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'properties.versionLevelWorm.timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'properties.versionLevelWorm.migrationState', 'type': 'str'}, } def __init__( @@ -358,6 +371,9 @@ def __init__( self.legal_hold = None self.has_legal_hold = None self.has_immutability_policy = None + self.enabled = kwargs.get('enabled', None) + self.time_stamp = None + self.migration_state = None class BlobInventoryPolicy(Resource): @@ -2482,6 +2498,14 @@ class ListContainerItem(AzureEntityResource): 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 + :param enabled: This is an immutable property, when set to true enables version level worm at + the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the version level worm was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level worm to version level worm + migration state. Possible values include: "InProgress", "Completed", "Abort". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_01_01.models.MigrationState """ _validation = { @@ -2501,6 +2525,8 @@ class ListContainerItem(AzureEntityResource): 'legal_hold': {'readonly': True}, 'has_legal_hold': {'readonly': True}, 'has_immutability_policy': {'readonly': True}, + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, } _attribute_map = { @@ -2524,6 +2550,9 @@ class ListContainerItem(AzureEntityResource): 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'enabled': {'key': 'properties.versionLevelWorm.enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'properties.versionLevelWorm.timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'properties.versionLevelWorm.migrationState', 'type': 'str'}, } def __init__( @@ -2547,6 +2576,9 @@ def __init__( self.legal_hold = None self.has_legal_hold = None self.has_immutability_policy = None + self.enabled = kwargs.get('enabled', None) + self.time_stamp = None + self.migration_state = None class ListContainerItems(msrest.serialization.Model): diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py index 4889b42a22d3..135d5eca6ba5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py @@ -317,6 +317,14 @@ class BlobContainer(AzureEntityResource): 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 + :param enabled: This is an immutable property, when set to true enables version level worm at + the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the version level worm was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level worm to version level worm + migration state. Possible values include: "InProgress", "Completed", "Abort". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_01_01.models.MigrationState """ _validation = { @@ -336,6 +344,8 @@ class BlobContainer(AzureEntityResource): 'legal_hold': {'readonly': True}, 'has_legal_hold': {'readonly': True}, 'has_immutability_policy': {'readonly': True}, + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, } _attribute_map = { @@ -359,6 +369,9 @@ class BlobContainer(AzureEntityResource): 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'enabled': {'key': 'properties.versionLevelWorm.enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'properties.versionLevelWorm.timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'properties.versionLevelWorm.migrationState', 'type': 'str'}, } def __init__( @@ -368,6 +381,7 @@ def __init__( deny_encryption_scope_override: Optional[bool] = None, public_access: Optional[Union[str, "PublicAccess"]] = None, metadata: Optional[Dict[str, str]] = None, + enabled: Optional[bool] = None, **kwargs ): super(BlobContainer, self).__init__(**kwargs) @@ -387,6 +401,9 @@ def __init__( self.legal_hold = None self.has_legal_hold = None self.has_immutability_policy = None + self.enabled = enabled + self.time_stamp = None + self.migration_state = None class BlobInventoryPolicy(Resource): @@ -2661,6 +2678,14 @@ class ListContainerItem(AzureEntityResource): 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 + :param enabled: This is an immutable property, when set to true enables version level worm at + the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the version level worm was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level worm to version level worm + migration state. Possible values include: "InProgress", "Completed", "Abort". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_01_01.models.MigrationState """ _validation = { @@ -2680,6 +2705,8 @@ class ListContainerItem(AzureEntityResource): 'legal_hold': {'readonly': True}, 'has_legal_hold': {'readonly': True}, 'has_immutability_policy': {'readonly': True}, + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, } _attribute_map = { @@ -2703,6 +2730,9 @@ class ListContainerItem(AzureEntityResource): 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'enabled': {'key': 'properties.versionLevelWorm.enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'properties.versionLevelWorm.timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'properties.versionLevelWorm.migrationState', 'type': 'str'}, } def __init__( @@ -2712,6 +2742,7 @@ def __init__( deny_encryption_scope_override: Optional[bool] = None, public_access: Optional[Union[str, "PublicAccess"]] = None, metadata: Optional[Dict[str, str]] = None, + enabled: Optional[bool] = None, **kwargs ): super(ListContainerItem, self).__init__(**kwargs) @@ -2731,6 +2762,9 @@ def __init__( self.legal_hold = None self.has_legal_hold = None self.has_immutability_policy = None + self.enabled = enabled + self.time_stamp = None + self.migration_state = None class ListContainerItems(msrest.serialization.Model): diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_storage_management_client_enums.py index bccc88e90fb0..a8ee6832776d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_storage_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_storage_management_client_enums.py @@ -268,6 +268,14 @@ class ManagementPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DEFAULT = "default" +class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property denotes the container level worm to version level worm migration state. + """ + + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + ABORT = "Abort" + 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. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_blob_containers_operations.py index 8c342651fa5a..8c1d6d496012 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_blob_containers_operations.py @@ -12,7 +12,9 @@ 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 @@ -1097,3 +1099,126 @@ def lease( return deserialized lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore + + def _version_level_worm_initial( + self, + resource_group_name, # type: str + account_name, # type: str + container_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 = "2021-01-01" + + # Construct URL + url = self._version_level_worm_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), + '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.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, 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, {}) + + _version_level_worm_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore + + def begin_version_level_worm( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """This operation migrates a blob container from container level WORM to version level WORM + enabled container. Prerequisites require a container level immutability policy either in locked + or unlocked state, Account level versioning must be enabled and there should be no Legal holds. + + :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 + :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._version_level_worm_initial( + resource_group_name=resource_group_name, + account_name=account_name, + container_name=container_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), + '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), + } + + 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_version_level_worm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore