Skip to content

Commit

Permalink
CodeGen from PR 12543 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge cfaa6c8bda15abfbe9246acfb01351f45e028a73 into 5e076b3
  • Loading branch information
SDKAuto committed Jan 28, 2021
1 parent 82e5afc commit 1d78323
Show file tree
Hide file tree
Showing 227 changed files with 28,373 additions and 2,271 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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.
Expand All @@ -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
}
Expand Down Expand Up @@ -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.
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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
Expand All @@ -44,15 +44,15 @@ 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
:return: An iterator like instance of either UsageListResult or the result of cls(response)
: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
}
Expand Down
Loading

0 comments on commit 1d78323

Please sign in to comment.