Skip to content

Commit

Permalink
T2 resource 2021 02 26 (#16961)
Browse files Browse the repository at this point in the history
* CodeGen from PR 13128 in Azure/azure-rest-api-specs
Revert "[Hub Generated] Review request for Microsoft.Resources to add version stable/2021-01-01 (#13000)" (#13128)

This reverts commit 231d094.

* test,version,CHANGELOG

* fix testcases

Co-authored-by: SDKAuto <[email protected]>
  • Loading branch information
00Kai0 and SDKAuto authored Mar 1, 2021
1 parent c6580d9 commit 79d9f53
Show file tree
Hide file tree
Showing 509 changed files with 65,346 additions and 45,780 deletions.
38 changes: 38 additions & 0 deletions sdk/resources/azure-mgmt-resource/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Release History

## 16.0.0 (2021-02-26)

**Features**

- Model ParameterDefinitionsValueMetadata has a new parameter strong_type
- Model ParameterDefinitionsValueMetadata has a new parameter assign_permissions
- Model ProviderResourceType has a new parameter location_mappings
- Model DeploymentProperties has a new parameter expression_evaluation_options
- Model PolicyAssignment has a new parameter non_compliance_messages
- Model TemplateLink has a new parameter query_string
- Model TemplateSpec has a new parameter versions
- Model DeploymentWhatIfProperties has a new parameter expression_evaluation_options
- Added operation ApplicationDefinitionsOperations.get_by_id
- Added operation ApplicationDefinitionsOperations.begin_create_or_update_by_id
- Added operation ApplicationDefinitionsOperations.begin_delete_by_id
- Added operation ProvidersOperations.register_at_management_group_scope
- Added operation PolicySetDefinitionsOperations.list_by_management_group
- Added operation PolicyDefinitionsOperations.list_by_management_group
- Added operation group ProviderResourceTypesOperations
- Added operation group DataPolicyManifestsOperations
- Added operation group ApplicationClientOperationsMixin
- Added operation group PolicyExemptionsOperations

**Breaking changes**

- Operation PolicyAssignmentsOperations.list has a new signature
- Operation PolicyAssignmentsOperations.list_for_management_group has a new signature
- Operation PolicyAssignmentsOperations.list_for_resource has a new signature
- Operation PolicyAssignmentsOperations.list_for_resource_group has a new signature
- Operation TemplateSpecsOperations.get has a new signature
- Operation TemplateSpecsOperations.list_by_resource_group has a new signature
- Operation TemplateSpecsOperations.list_by_subscription has a new signature
- Model PolicyAssignment no longer has parameter sku
- Operation PolicySetDefinitionsOperations.list_built_in has a new signature
- Operation PolicySetDefinitionsOperations.list has a new signature
- Operation PolicyDefinitionsOperations.list_built_in has a new signature
- Operation PolicyDefinitionsOperations.list has a new signature

## 15.0.0 (2020-09-17)

**Features**
Expand Down
10 changes: 10 additions & 0 deletions sdk/resources/azure-mgmt-resource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ section of the project.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-resource%2FREADME.png)
# Usage


To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)



For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
Code samples for this package can be found at [Resource Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "15.0.0"
VERSION = "16.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "0.1.0"
VERSION = "16.0.0"
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.deployment_scripts = DeploymentScriptsOperations(
Expand Down
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 Id which 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 Id which 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 @@ -47,7 +47,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.deployment_scripts = DeploymentScriptsOperations(
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 DeploymentScriptsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -47,10 +47,10 @@ async def _create_initial(
self,
resource_group_name: str,
script_name: str,
deployment_script: "models.DeploymentScript",
deployment_script: "_models.DeploymentScript",
**kwargs
) -> "models.DeploymentScript":
cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentScript"]
) -> "_models.DeploymentScript":
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScript"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -86,7 +86,7 @@ async def _create_initial(

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand All @@ -105,9 +105,9 @@ async def begin_create(
self,
resource_group_name: str,
script_name: str,
deployment_script: "models.DeploymentScript",
deployment_script: "_models.DeploymentScript",
**kwargs
) -> AsyncLROPoller["models.DeploymentScript"]:
) -> AsyncLROPoller["_models.DeploymentScript"]:
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -127,7 +127,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.DeploymentScript"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScript"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
Expand All @@ -152,7 +152,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 = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, 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:
Expand All @@ -170,9 +176,9 @@ async def update(
self,
resource_group_name: str,
script_name: str,
deployment_script: Optional["models.DeploymentScriptUpdateParameter"] = None,
deployment_script: Optional["_models.DeploymentScriptUpdateParameter"] = None,
**kwargs
) -> "models.DeploymentScript":
) -> "_models.DeploymentScript":
"""Updates deployment script tags with specified values.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -186,7 +192,7 @@ async def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentScript"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScript"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -225,7 +231,7 @@ async def update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('DeploymentScript', pipeline_response)
Expand All @@ -241,7 +247,7 @@ async def get(
resource_group_name: str,
script_name: str,
**kwargs
) -> "models.DeploymentScript":
) -> "_models.DeploymentScript":
"""Gets a deployment script with a given name.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -253,7 +259,7 @@ async def get(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentScript"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScript"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -284,7 +290,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('DeploymentScript', pipeline_response)
Expand Down Expand Up @@ -344,7 +350,7 @@ async def delete(

if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand All @@ -355,15 +361,15 @@ async def delete(
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["models.DeploymentScriptListResult"]:
) -> AsyncIterable["_models.DeploymentScriptListResult"]:
"""Lists all deployment scripts for a given subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentScriptListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScriptListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentScriptListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScriptListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -408,7 +414,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -424,7 +430,7 @@ async def get_logs(
resource_group_name: str,
script_name: str,
**kwargs
) -> "models.ScriptLogsList":
) -> "_models.ScriptLogsList":
"""Gets deployment script logs for a given deployment script name.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -436,7 +442,7 @@ async def get_logs(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLogsList
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ScriptLogsList"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptLogsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -467,7 +473,7 @@ async def get_logs(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ScriptLogsList', pipeline_response)
Expand All @@ -484,7 +490,7 @@ async def get_logs_default(
script_name: str,
tail: Optional[int] = None,
**kwargs
) -> "models.ScriptLog":
) -> "_models.ScriptLog":
"""Gets deployment script logs for a given deployment script name.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -500,7 +506,7 @@ async def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLog
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ScriptLog"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptLog"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -533,7 +539,7 @@ async def get_logs_default(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ScriptLog', pipeline_response)
Expand All @@ -548,7 +554,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["models.DeploymentScriptListResult"]:
) -> AsyncIterable["_models.DeploymentScriptListResult"]:
"""Lists deployments scripts.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -558,7 +564,7 @@ def list_by_resource_group(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScriptListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentScriptListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentScriptListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -604,7 +610,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.DeploymentScriptsError, response)
error = self._deserialize(_models.DeploymentScriptsError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Loading

0 comments on commit 79d9f53

Please sign in to comment.