1616from azure .mgmt .core .exceptions import ARMErrorFormat
1717from azure .mgmt .core .polling .async_arm_polling import AsyncARMPolling
1818
19- from ... import models
19+ from ... import models as _models
2020
2121T = TypeVar ('T' )
2222ClsType = Optional [Callable [[PipelineResponse [HttpRequest , AsyncHttpResponse ], T , Dict [str , Any ]], Any ]]
@@ -35,7 +35,7 @@ class StorageAccountsOperations:
3535 :param deserializer: An object model deserializer.
3636 """
3737
38- models = models
38+ models = _models
3939
4040 def __init__ (self , client , config , serializer , deserializer ) -> None :
4141 self ._client = client
@@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4545
4646 async def check_name_availability (
4747 self ,
48- account_name : "models .StorageAccountCheckNameAvailabilityParameters" ,
48+ account_name : "_models .StorageAccountCheckNameAvailabilityParameters" ,
4949 ** kwargs
50- ) -> "models .CheckNameAvailabilityResult" :
50+ ) -> "_models .CheckNameAvailabilityResult" :
5151 """Checks that the storage account name is valid and is not already in use.
5252
5353 :param account_name: The name of the storage account within the specified resource group.
@@ -59,7 +59,7 @@ async def check_name_availability(
5959 :rtype: ~azure.mgmt.storage.v2015_06_15.models.CheckNameAvailabilityResult
6060 :raises: ~azure.core.exceptions.HttpResponseError
6161 """
62- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .CheckNameAvailabilityResult"]
62+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .CheckNameAvailabilityResult"]
6363 error_map = {
6464 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
6565 }
@@ -107,10 +107,10 @@ async def _create_initial(
107107 self ,
108108 resource_group_name : str ,
109109 account_name : str ,
110- parameters : "models .StorageAccountCreateParameters" ,
110+ parameters : "_models .StorageAccountCreateParameters" ,
111111 ** kwargs
112- ) -> Optional ["models .StorageAccount" ]:
113- cls = kwargs .pop ('cls' , None ) # type: ClsType[Optional["models .StorageAccount"]]
112+ ) -> Optional ["_models .StorageAccount" ]:
113+ cls = kwargs .pop ('cls' , None ) # type: ClsType[Optional["_models .StorageAccount"]]
114114 error_map = {
115115 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
116116 }
@@ -162,9 +162,9 @@ async def begin_create(
162162 self ,
163163 resource_group_name : str ,
164164 account_name : str ,
165- parameters : "models .StorageAccountCreateParameters" ,
165+ parameters : "_models .StorageAccountCreateParameters" ,
166166 ** kwargs
167- ) -> AsyncLROPoller ["models .StorageAccount" ]:
167+ ) -> AsyncLROPoller ["_models .StorageAccount" ]:
168168 """Asynchronously creates a new storage account with the specified parameters. If an account is
169169 already created and a subsequent create request is issued with different properties, the
170170 account properties will be updated. If an account is already created and a subsequent create or
@@ -190,7 +190,7 @@ async def begin_create(
190190 :raises ~azure.core.exceptions.HttpResponseError:
191191 """
192192 polling = kwargs .pop ('polling' , True ) # type: Union[bool, AsyncPollingMethod]
193- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccount"]
193+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccount"]
194194 lro_delay = kwargs .pop (
195195 'polling_interval' ,
196196 self ._config .polling_interval
@@ -215,7 +215,13 @@ def get_long_running_output(pipeline_response):
215215 return cls (pipeline_response , deserialized , {})
216216 return deserialized
217217
218- if polling is True : polling_method = AsyncARMPolling (lro_delay , ** kwargs )
218+ path_format_arguments = {
219+ 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' , max_length = 90 , min_length = 1 , pattern = r'^[-\w\._\(\)]+$' ),
220+ 'accountName' : self ._serialize .url ("account_name" , account_name , 'str' , max_length = 24 , min_length = 3 ),
221+ 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
222+ }
223+
224+ if polling is True : polling_method = AsyncARMPolling (lro_delay , path_format_arguments = path_format_arguments , ** kwargs )
219225 elif polling is False : polling_method = AsyncNoPolling ()
220226 else : polling_method = polling
221227 if cont_token :
@@ -290,7 +296,7 @@ async def get_properties(
290296 resource_group_name : str ,
291297 account_name : str ,
292298 ** kwargs
293- ) -> "models .StorageAccount" :
299+ ) -> "_models .StorageAccount" :
294300 """Returns the properties for the specified storage account including but not limited to name, SKU
295301 name, location, and account status. The ListKeys operation should be used to retrieve storage
296302 keys.
@@ -307,7 +313,7 @@ async def get_properties(
307313 :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount
308314 :raises: ~azure.core.exceptions.HttpResponseError
309315 """
310- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccount"]
316+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccount"]
311317 error_map = {
312318 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
313319 }
@@ -352,9 +358,9 @@ async def update(
352358 self ,
353359 resource_group_name : str ,
354360 account_name : str ,
355- parameters : "models .StorageAccountUpdateParameters" ,
361+ parameters : "_models .StorageAccountUpdateParameters" ,
356362 ** kwargs
357- ) -> "models .StorageAccount" :
363+ ) -> "_models .StorageAccount" :
358364 """The update operation can be used to update the SKU, encryption, access tier, or tags for a
359365 storage account. It can also be used to map the account to a custom domain. Only one custom
360366 domain is supported per storage account; the replacement/change of custom domain is not
@@ -378,7 +384,7 @@ async def update(
378384 :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount
379385 :raises: ~azure.core.exceptions.HttpResponseError
380386 """
381- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccount"]
387+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccount"]
382388 error_map = {
383389 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
384390 }
@@ -427,7 +433,7 @@ async def update(
427433 def list (
428434 self ,
429435 ** kwargs
430- ) -> AsyncIterable ["models .StorageAccountListResult" ]:
436+ ) -> AsyncIterable ["_models .StorageAccountListResult" ]:
431437 """Lists all the storage accounts available under the subscription. Note that storage keys are not
432438 returned; use the ListKeys operation for this.
433439
@@ -436,7 +442,7 @@ def list(
436442 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult]
437443 :raises: ~azure.core.exceptions.HttpResponseError
438444 """
439- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccountListResult"]
445+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccountListResult"]
440446 error_map = {
441447 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
442448 }
@@ -495,7 +501,7 @@ def list_by_resource_group(
495501 self ,
496502 resource_group_name : str ,
497503 ** kwargs
498- ) -> AsyncIterable ["models .StorageAccountListResult" ]:
504+ ) -> AsyncIterable ["_models .StorageAccountListResult" ]:
499505 """Lists all the storage accounts available under the given resource group. Note that storage keys
500506 are not returned; use the ListKeys operation for this.
501507
@@ -507,7 +513,7 @@ def list_by_resource_group(
507513 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccountListResult]
508514 :raises: ~azure.core.exceptions.HttpResponseError
509515 """
510- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccountListResult"]
516+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccountListResult"]
511517 error_map = {
512518 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
513519 }
@@ -568,7 +574,7 @@ async def list_keys(
568574 resource_group_name : str ,
569575 account_name : str ,
570576 ** kwargs
571- ) -> "models .StorageAccountKeys" :
577+ ) -> "_models .StorageAccountKeys" :
572578 """Lists the access keys for the specified storage account.
573579
574580 :param resource_group_name: The name of the resource group within the user's subscription. The
@@ -583,7 +589,7 @@ async def list_keys(
583589 :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys
584590 :raises: ~azure.core.exceptions.HttpResponseError
585591 """
586- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccountKeys"]
592+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccountKeys"]
587593 error_map = {
588594 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
589595 }
@@ -628,9 +634,9 @@ async def regenerate_key(
628634 self ,
629635 resource_group_name : str ,
630636 account_name : str ,
631- regenerate_key : "models .StorageAccountRegenerateKeyParameters" ,
637+ regenerate_key : "_models .StorageAccountRegenerateKeyParameters" ,
632638 ** kwargs
633- ) -> "models .StorageAccountKeys" :
639+ ) -> "_models .StorageAccountKeys" :
634640 """Regenerates one of the access keys for the specified storage account.
635641
636642 :param resource_group_name: The name of the resource group within the user's subscription. The
@@ -647,7 +653,7 @@ async def regenerate_key(
647653 :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys
648654 :raises: ~azure.core.exceptions.HttpResponseError
649655 """
650- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .StorageAccountKeys"]
656+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .StorageAccountKeys"]
651657 error_map = {
652658 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
653659 }
0 commit comments