Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-resource] Re-order parameter added in PR #11637 to avoid breaking change in SDK #3146

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ def __init__(
class DeploymentScriptsError(msrest.serialization.Model):
"""Deployment scripts error response.

:param error: The resource management error response.
:param error: Common error response for all Azure Resource Manager APIs to return error details
for failed operations. (This also follows the OData error response format.).
:type error: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ErrorResponse
"""

Expand Down Expand Up @@ -895,7 +896,7 @@ def __init__(


class ErrorResponse(msrest.serialization.Model):
"""The resource management error response.
"""Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

Variables are only populated by the server, and will be ignored when sending a request.

Expand Down Expand Up @@ -947,6 +948,8 @@ class ManagedServiceIdentity(msrest.serialization.Model):
:param type: Type of the managed identity. Possible values include: "UserAssigned".
:type type: str or
~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ManagedServiceIdentityType
:param tenant_id: ID of the Azure Active Directory.
:type tenant_id: str
:param user_assigned_identities: The list of user-assigned managed identities associated with
the resource. Key is the Azure resource Id of the managed identity.
:type user_assigned_identities: dict[str,
Expand All @@ -955,6 +958,7 @@ class ManagedServiceIdentity(msrest.serialization.Model):

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'},
}

Expand All @@ -964,6 +968,7 @@ def __init__(
):
super(ManagedServiceIdentity, self).__init__(**kwargs)
self.type = kwargs.get('type', None)
self.tenant_id = kwargs.get('tenant_id', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)


Expand Down
Loading