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 VaultsOperations:
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
@@ -47,9 +47,9 @@ async def create_or_update(
4747 self ,
4848 resource_group_name : str ,
4949 vault_name : str ,
50- parameters : "models .VaultCreateOrUpdateParameters" ,
50+ parameters : "_models .VaultCreateOrUpdateParameters" ,
5151 ** kwargs
52- ) -> "models .Vault" :
52+ ) -> "_models .Vault" :
5353 """Create or update a key vault in the specified subscription.
5454
5555 :param resource_group_name: The name of the Resource Group to which the server belongs.
@@ -63,7 +63,7 @@ async def create_or_update(
6363 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
6464 :raises: ~azure.core.exceptions.HttpResponseError
6565 """
66- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .Vault"]
66+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .Vault"]
6767 error_map = {
6868 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
6969 }
@@ -117,9 +117,9 @@ async def update(
117117 self ,
118118 resource_group_name : str ,
119119 vault_name : str ,
120- parameters : "models .VaultPatchParameters" ,
120+ parameters : "_models .VaultPatchParameters" ,
121121 ** kwargs
122- ) -> "models .Vault" :
122+ ) -> "_models .Vault" :
123123 """Update a key vault in the specified subscription.
124124
125125 :param resource_group_name: The name of the Resource Group to which the server belongs.
@@ -133,7 +133,7 @@ async def update(
133133 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
134134 :raises: ~azure.core.exceptions.HttpResponseError
135135 """
136- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .Vault"]
136+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .Vault"]
137137 error_map = {
138138 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
139139 }
@@ -241,7 +241,7 @@ async def get(
241241 resource_group_name : str ,
242242 vault_name : str ,
243243 ** kwargs
244- ) -> "models .Vault" :
244+ ) -> "_models .Vault" :
245245 """Gets the specified Azure key vault.
246246
247247 :param resource_group_name: The name of the Resource Group to which the vault belongs.
@@ -253,7 +253,7 @@ async def get(
253253 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
254254 :raises: ~azure.core.exceptions.HttpResponseError
255255 """
256- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .Vault"]
256+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .Vault"]
257257 error_map = {
258258 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
259259 }
@@ -298,10 +298,10 @@ async def update_access_policy(
298298 self ,
299299 resource_group_name : str ,
300300 vault_name : str ,
301- operation_kind : Union [str , "models .AccessPolicyUpdateKind" ],
302- parameters : "models .VaultAccessPolicyParameters" ,
301+ operation_kind : Union [str , "_models .AccessPolicyUpdateKind" ],
302+ parameters : "_models .VaultAccessPolicyParameters" ,
303303 ** kwargs
304- ) -> "models .VaultAccessPolicyParameters" :
304+ ) -> "_models .VaultAccessPolicyParameters" :
305305 """Update access policies in a key vault in the specified subscription.
306306
307307 :param resource_group_name: The name of the Resource Group to which the vault belongs.
@@ -317,7 +317,7 @@ async def update_access_policy(
317317 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.VaultAccessPolicyParameters
318318 :raises: ~azure.core.exceptions.HttpResponseError
319319 """
320- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .VaultAccessPolicyParameters"]
320+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .VaultAccessPolicyParameters"]
321321 error_map = {
322322 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
323323 }
@@ -373,7 +373,7 @@ def list_by_resource_group(
373373 resource_group_name : str ,
374374 top : Optional [int ] = None ,
375375 ** kwargs
376- ) -> AsyncIterable ["models .VaultListResult" ]:
376+ ) -> AsyncIterable ["_models .VaultListResult" ]:
377377 """The List operation gets information about the vaults associated with the subscription and
378378 within the specified resource group.
379379
@@ -386,7 +386,7 @@ def list_by_resource_group(
386386 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.VaultListResult]
387387 :raises: ~azure.core.exceptions.HttpResponseError
388388 """
389- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .VaultListResult"]
389+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .VaultListResult"]
390390 error_map = {
391391 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
392392 }
@@ -448,7 +448,7 @@ def list_by_subscription(
448448 self ,
449449 top : Optional [int ] = None ,
450450 ** kwargs
451- ) -> AsyncIterable ["models .VaultListResult" ]:
451+ ) -> AsyncIterable ["_models .VaultListResult" ]:
452452 """The List operation gets information about the vaults associated with the subscription.
453453
454454 :param top: Maximum number of results to return.
@@ -458,7 +458,7 @@ def list_by_subscription(
458458 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.VaultListResult]
459459 :raises: ~azure.core.exceptions.HttpResponseError
460460 """
461- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .VaultListResult"]
461+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .VaultListResult"]
462462 error_map = {
463463 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
464464 }
@@ -518,15 +518,15 @@ async def get_next(next_link=None):
518518 def list_deleted (
519519 self ,
520520 ** kwargs
521- ) -> AsyncIterable ["models .DeletedVaultListResult" ]:
521+ ) -> AsyncIterable ["_models .DeletedVaultListResult" ]:
522522 """Gets information about the deleted vaults in a subscription.
523523
524524 :keyword callable cls: A custom type or function that will be passed the direct response
525525 :return: An iterator like instance of either DeletedVaultListResult or the result of cls(response)
526526 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.DeletedVaultListResult]
527527 :raises: ~azure.core.exceptions.HttpResponseError
528528 """
529- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DeletedVaultListResult"]
529+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DeletedVaultListResult"]
530530 error_map = {
531531 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
532532 }
@@ -586,7 +586,7 @@ async def get_deleted(
586586 vault_name : str ,
587587 location : str ,
588588 ** kwargs
589- ) -> "models .DeletedVault" :
589+ ) -> "_models .DeletedVault" :
590590 """Gets the deleted Azure key vault.
591591
592592 :param vault_name: The name of the vault.
@@ -598,7 +598,7 @@ async def get_deleted(
598598 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.DeletedVault
599599 :raises: ~azure.core.exceptions.HttpResponseError
600600 """
601- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .DeletedVault"]
601+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .DeletedVault"]
602602 error_map = {
603603 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
604604 }
@@ -725,7 +725,13 @@ def get_long_running_output(pipeline_response):
725725 if cls :
726726 return cls (pipeline_response , None , {})
727727
728- if polling is True : polling_method = AsyncARMPolling (lro_delay , ** kwargs )
728+ path_format_arguments = {
729+ 'vaultName' : self ._serialize .url ("vault_name" , vault_name , 'str' ),
730+ 'location' : self ._serialize .url ("location" , location , 'str' ),
731+ 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
732+ }
733+
734+ if polling is True : polling_method = AsyncARMPolling (lro_delay , path_format_arguments = path_format_arguments , ** kwargs )
729735 elif polling is False : polling_method = AsyncNoPolling ()
730736 else : polling_method = polling
731737 if cont_token :
@@ -743,7 +749,7 @@ def list(
743749 self ,
744750 top : Optional [int ] = None ,
745751 ** kwargs
746- ) -> AsyncIterable ["models .ResourceListResult" ]:
752+ ) -> AsyncIterable ["_models .ResourceListResult" ]:
747753 """The List operation gets information about the vaults associated with the subscription.
748754
749755 :param top: Maximum number of results to return.
@@ -753,7 +759,7 @@ def list(
753759 :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.ResourceListResult]
754760 :raises: ~azure.core.exceptions.HttpResponseError
755761 """
756- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .ResourceListResult"]
762+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .ResourceListResult"]
757763 error_map = {
758764 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
759765 }
@@ -814,9 +820,9 @@ async def get_next(next_link=None):
814820
815821 async def check_name_availability (
816822 self ,
817- vault_name : "models .VaultCheckNameAvailabilityParameters" ,
823+ vault_name : "_models .VaultCheckNameAvailabilityParameters" ,
818824 ** kwargs
819- ) -> "models .CheckNameAvailabilityResult" :
825+ ) -> "_models .CheckNameAvailabilityResult" :
820826 """Checks that the vault name is valid and is not already in use.
821827
822828 :param vault_name: The name of the vault.
@@ -826,7 +832,7 @@ async def check_name_availability(
826832 :rtype: ~azure.mgmt.keyvault.v2016_10_01.models.CheckNameAvailabilityResult
827833 :raises: ~azure.core.exceptions.HttpResponseError
828834 """
829- cls = kwargs .pop ('cls' , None ) # type: ClsType["models .CheckNameAvailabilityResult"]
835+ cls = kwargs .pop ('cls' , None ) # type: ClsType["_models .CheckNameAvailabilityResult"]
830836 error_map = {
831837 401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
832838 }
0 commit comments