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 AccountsOperations:
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
@@ -52,7 +52,7 @@ def list(
5252 orderby : Optional [str ] = None ,
5353 count : Optional [bool ] = None ,
5454 ** kwargs
55- ) -> AsyncIterable ["models .DataLakeStoreAccountListResult" ]:
55+ ) -> AsyncIterable ["_models .DataLakeStoreAccountListResult" ]:
5656 """Lists the Data Lake Store accounts within the subscription. The response includes a link to the
5757 next page of results, if any.
5858
@@ -77,7 +77,7 @@ def list(
7777 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datalake.store.models.DataLakeStoreAccountListResult]
7878 :raises: ~azure.core.exceptions.HttpResponseError
7979 """
80- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccountListResult"]
80+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccountListResult"]
8181 error_map = {
8282 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
8383 }
@@ -154,7 +154,7 @@ def list_by_resource_group(
154154 orderby : Optional [str ] = None ,
155155 count : Optional [bool ] = None ,
156156 ** kwargs
157- ) -> AsyncIterable ["models .DataLakeStoreAccountListResult" ]:
157+ ) -> AsyncIterable ["_models .DataLakeStoreAccountListResult" ]:
158158 """Lists the Data Lake Store accounts within a specific resource group. The response includes a
159159 link to the next page of results, if any.
160160
@@ -181,7 +181,7 @@ def list_by_resource_group(
181181 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datalake.store.models.DataLakeStoreAccountListResult]
182182 :raises: ~azure.core.exceptions.HttpResponseError
183183 """
184- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccountListResult"]
184+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccountListResult"]
185185 error_map = {
186186 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
187187 }
@@ -253,10 +253,10 @@ async def _create_initial(
253253 self ,
254254 resource_group_name : str ,
255255 account_name : str ,
256- parameters : "models .CreateDataLakeStoreAccountParameters" ,
256+ parameters : "_models .CreateDataLakeStoreAccountParameters" ,
257257 ** kwargs
258- ) -> "models .DataLakeStoreAccount" :
259- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccount"]
258+ ) -> "_models .DataLakeStoreAccount" :
259+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccount"]
260260 error_map = {
261261 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
262262 }
@@ -310,9 +310,9 @@ async def begin_create(
310310 self ,
311311 resource_group_name : str ,
312312 account_name : str ,
313- parameters : "models .CreateDataLakeStoreAccountParameters" ,
313+ parameters : "_models .CreateDataLakeStoreAccountParameters" ,
314314 ** kwargs
315- ) -> AsyncLROPoller ["models .DataLakeStoreAccount" ]:
315+ ) -> AsyncLROPoller ["_models .DataLakeStoreAccount" ]:
316316 """Creates the specified Data Lake Store account.
317317
318318 :param resource_group_name: The name of the Azure resource group.
@@ -332,7 +332,7 @@ async def begin_create(
332332 :raises ~azure.core.exceptions.HttpResponseError:
333333 """
334334 polling = kwargs .pop ('polling' , True ) # type: Union[bool, AsyncPollingMethod]
335- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccount"]
335+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccount"]
336336 lro_delay = kwargs .pop (
337337 'polling_interval' ,
338338 self ._config .polling_interval
@@ -357,7 +357,13 @@ def get_long_running_output(pipeline_response):
357357 return cls (pipeline_response , deserialized , {})
358358 return deserialized
359359
360- if polling is True : polling_method = AsyncARMPolling (lro_delay , ** kwargs )
360+ path_format_arguments = {
361+ 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
362+ 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' ),
363+ 'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
364+ }
365+
366+ if polling is True : polling_method = AsyncARMPolling (lro_delay , path_format_arguments = path_format_arguments , ** kwargs )
361367 elif polling is False : polling_method = AsyncNoPolling ()
362368 else : polling_method = polling
363369 if cont_token :
@@ -376,7 +382,7 @@ async def get(
376382 resource_group_name : str ,
377383 account_name : str ,
378384 ** kwargs
379- ) -> "models .DataLakeStoreAccount" :
385+ ) -> "_models .DataLakeStoreAccount" :
380386 """Gets the specified Data Lake Store account.
381387
382388 :param resource_group_name: The name of the Azure resource group.
@@ -388,7 +394,7 @@ async def get(
388394 :rtype: ~azure.mgmt.datalake.store.models.DataLakeStoreAccount
389395 :raises: ~azure.core.exceptions.HttpResponseError
390396 """
391- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccount"]
397+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccount"]
392398 error_map = {
393399 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
394400 }
@@ -433,10 +439,10 @@ async def _update_initial(
433439 self ,
434440 resource_group_name : str ,
435441 account_name : str ,
436- parameters : "models .UpdateDataLakeStoreAccountParameters" ,
442+ parameters : "_models .UpdateDataLakeStoreAccountParameters" ,
437443 ** kwargs
438- ) -> "models .DataLakeStoreAccount" :
439- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccount"]
444+ ) -> "_models .DataLakeStoreAccount" :
445+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccount"]
440446 error_map = {
441447 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
442448 }
@@ -493,9 +499,9 @@ async def begin_update(
493499 self ,
494500 resource_group_name : str ,
495501 account_name : str ,
496- parameters : "models .UpdateDataLakeStoreAccountParameters" ,
502+ parameters : "_models .UpdateDataLakeStoreAccountParameters" ,
497503 ** kwargs
498- ) -> AsyncLROPoller ["models .DataLakeStoreAccount" ]:
504+ ) -> AsyncLROPoller ["_models .DataLakeStoreAccount" ]:
499505 """Updates the specified Data Lake Store account information.
500506
501507 :param resource_group_name: The name of the Azure resource group.
@@ -515,7 +521,7 @@ async def begin_update(
515521 :raises ~azure.core.exceptions.HttpResponseError:
516522 """
517523 polling = kwargs .pop ('polling' , True ) # type: Union[bool, AsyncPollingMethod]
518- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DataLakeStoreAccount"]
524+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DataLakeStoreAccount"]
519525 lro_delay = kwargs .pop (
520526 'polling_interval' ,
521527 self ._config .polling_interval
@@ -540,7 +546,13 @@ def get_long_running_output(pipeline_response):
540546 return cls (pipeline_response , deserialized , {})
541547 return deserialized
542548
543- if polling is True : polling_method = AsyncARMPolling (lro_delay , ** kwargs )
549+ path_format_arguments = {
550+ 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
551+ 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' ),
552+ 'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
553+ }
554+
555+ if polling is True : polling_method = AsyncARMPolling (lro_delay , path_format_arguments = path_format_arguments , ** kwargs )
544556 elif polling is False : polling_method = AsyncNoPolling ()
545557 else : polling_method = polling
546558 if cont_token :
@@ -640,7 +652,13 @@ def get_long_running_output(pipeline_response):
640652 if cls :
641653 return cls (pipeline_response , None , {})
642654
643- if polling is True : polling_method = AsyncARMPolling (lro_delay , ** kwargs )
655+ path_format_arguments = {
656+ 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
657+ 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' ),
658+ 'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
659+ }
660+
661+ if polling is True : polling_method = AsyncARMPolling (lro_delay , path_format_arguments = path_format_arguments , ** kwargs )
644662 elif polling is False : polling_method = AsyncNoPolling ()
645663 else : polling_method = polling
646664 if cont_token :
@@ -711,27 +729,25 @@ async def enable_key_vault(
711729 async def check_name_availability (
712730 self ,
713731 location : str ,
714- name : str ,
732+ parameters : "_models.CheckNameAvailabilityParameters" ,
715733 ** kwargs
716- ) -> "models .NameAvailabilityInformation" :
734+ ) -> "_models .NameAvailabilityInformation" :
717735 """Checks whether the specified account name is available or taken.
718736
719737 :param location: The resource location without whitespace.
720738 :type location: str
721- :param name: The Data Lake Store name to check availability for .
722- :type name: str
739+ :param parameters: Parameters supplied to check the Data Lake Store account name availability.
740+ :type parameters: ~azure.mgmt.datalake.store.models.CheckNameAvailabilityParameters
723741 :keyword callable cls: A custom type or function that will be passed the direct response
724742 :return: NameAvailabilityInformation, or the result of cls(response)
725743 :rtype: ~azure.mgmt.datalake.store.models.NameAvailabilityInformation
726744 :raises: ~azure.core.exceptions.HttpResponseError
727745 """
728- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .NameAvailabilityInformation"]
746+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .NameAvailabilityInformation"]
729747 error_map = {
730748 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
731749 }
732750 error_map .update (kwargs .pop ('error_map' , {}))
733-
734- _parameters = models .CheckNameAvailabilityParameters (name = name )
735751 api_version = "2016-11-01"
736752 content_type = kwargs .pop ("content_type" , "application/json" )
737753 accept = "application/json"
@@ -754,7 +770,7 @@ async def check_name_availability(
754770 header_parameters ['Accept' ] = self ._serialize .header ("accept" , accept , 'str' )
755771
756772 body_content_kwargs = {} # type: Dict[str, Any]
757- body_content = self ._serialize .body (_parameters , 'CheckNameAvailabilityParameters' )
773+ body_content = self ._serialize .body (parameters , 'CheckNameAvailabilityParameters' )
758774 body_content_kwargs ['content' ] = body_content
759775 request = self ._client .post (url , query_parameters , header_parameters , ** body_content_kwargs )
760776 pipeline_response = await self ._client ._pipeline .run (request , stream = False , ** kwargs )
0 commit comments