From 097420c6c0a02ca44fb730c2feae5a05367dcab8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Aug 2021 02:22:45 +0000 Subject: [PATCH] CodeGen from PR 15745 in Azure/azure-rest-api-specs relay_track2_config (#15745) * relay_track2_config * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- sdk/relay/azure-mgmt-relay/MANIFEST.in | 1 + sdk/relay/azure-mgmt-relay/_meta.json | 11 ++ .../azure/mgmt/relay/_metadata.json | 106 ++++++++++++++++++ .../azure/mgmt/relay/_relay_api.py | 19 ++++ .../azure/mgmt/relay/_version.py | 2 +- .../azure/mgmt/relay/aio/_relay_api.py | 18 +++ .../_hybrid_connections_operations.py | 40 +++---- .../aio/operations/_namespaces_operations.py | 64 +++++------ .../mgmt/relay/aio/operations/_operations.py | 4 +- .../aio/operations/_wcf_relays_operations.py | 38 +++---- .../azure/mgmt/relay/models/_models.py | 10 +- .../azure/mgmt/relay/models/_models_py3.py | 12 +- .../_hybrid_connections_operations.py | 20 ++-- .../operations/_namespaces_operations.py | 34 +++--- .../mgmt/relay/operations/_operations.py | 2 +- .../operations/_wcf_relays_operations.py | 18 +-- 16 files changed, 278 insertions(+), 121 deletions(-) create mode 100644 sdk/relay/azure-mgmt-relay/_meta.json create mode 100644 sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_metadata.json diff --git a/sdk/relay/azure-mgmt-relay/MANIFEST.in b/sdk/relay/azure-mgmt-relay/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/relay/azure-mgmt-relay/MANIFEST.in +++ b/sdk/relay/azure-mgmt-relay/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/relay/azure-mgmt-relay/_meta.json b/sdk/relay/azure-mgmt-relay/_meta.json new file mode 100644 index 000000000000..13e1e65bcc38 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "327b222a6bb23bd1edfe14a75fd8cdc53b4faf61", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/relay/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/relay/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_metadata.json b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_metadata.json new file mode 100644 index 000000000000..4ce42f2ebea1 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_metadata.json @@ -0,0 +1,106 @@ +{ + "chosen_version": "2017-04-01", + "total_api_version_list": ["2017-04-01"], + "client": { + "name": "RelayAPI", + "filename": "_relay_api", + "description": "Use these API to manage Azure Relay resources through Azure Resource Manager.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RelayAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RelayAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "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": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: 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 + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "namespaces": "NamespacesOperations", + "hybrid_connections": "HybridConnectionsOperations", + "wcf_relays": "WCFRelaysOperations" + } +} \ No newline at end of file diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py index 0786f6e6b3c6..3bfceca35349 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import RelayAPIConfiguration from .operations import Operations @@ -71,6 +72,24 @@ def __init__( self.wcf_relays = WCFRelaysOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py index 1d0bdc654b74..fcc4e8abe27e 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -68,6 +69,23 @@ def __init__( self.wcf_relays = WCFRelaysOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py index a017bbf53d20..9a8ddf571bee 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py @@ -45,7 +45,7 @@ def list_by_namespace( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.HybridConnectionListResult"]: """Lists the hybrid connection within the namespace. @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -122,7 +122,7 @@ async def create_or_update( namespace_name: str, hybrid_connection_name: str, parameters: "_models.HybridConnection", - **kwargs + **kwargs: Any ) -> "_models.HybridConnection": """Creates or updates a service hybrid connection. This operation is idempotent. @@ -176,7 +176,7 @@ async def create_or_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HybridConnection', pipeline_response) @@ -192,7 +192,7 @@ async def delete( resource_group_name: str, namespace_name: str, hybrid_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a hybrid connection. @@ -239,7 +239,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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -252,7 +252,7 @@ async def get( resource_group_name: str, namespace_name: str, hybrid_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.HybridConnection": """Returns the description for the specified hybrid connection. @@ -299,7 +299,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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HybridConnection', pipeline_response) @@ -315,7 +315,7 @@ def list_authorization_rules( resource_group_name: str, namespace_name: str, hybrid_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Authorization rules for a hybrid connection. @@ -378,7 +378,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -396,7 +396,7 @@ async def create_or_update_authorization_rule( hybrid_connection_name: str, authorization_rule_name: str, parameters: "_models.AuthorizationRule", - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Creates or updates an authorization rule for a hybrid connection. @@ -453,7 +453,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -470,7 +470,7 @@ async def delete_authorization_rule( namespace_name: str, hybrid_connection_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a hybrid connection authorization rule. @@ -520,7 +520,7 @@ async def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -534,7 +534,7 @@ async def get_authorization_rule( namespace_name: str, hybrid_connection_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Hybrid connection authorization rule for a hybrid connection by name. @@ -584,7 +584,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -601,7 +601,7 @@ async def list_keys( namespace_name: str, hybrid_connection_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Primary and secondary connection strings to the hybrid connection. @@ -651,7 +651,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -669,7 +669,7 @@ async def regenerate_keys( hybrid_connection_name: str, authorization_rule_name: str, parameters: "_models.RegenerateAccessKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Regenerates the primary or secondary connection strings to the hybrid connection. @@ -726,7 +726,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py index f5e251146c16..0a213e54d254 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, parameters: "_models.CheckNameAvailability", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Check the specified namespace name availability. @@ -91,7 +91,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -104,7 +104,7 @@ async def check_name_availability( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.RelayNamespaceListResult"]: """Lists all the available namespaces within the subscription regardless of the resourceGroups. @@ -158,7 +158,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -172,7 +172,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.RelayNamespaceListResult"]: """Lists all the available namespaces within the ResourceGroup. @@ -229,7 +229,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -245,7 +245,7 @@ async def _create_or_update_initial( resource_group_name: str, namespace_name: str, parameters: "_models.RelayNamespace", - **kwargs + **kwargs: Any ) -> "_models.RelayNamespace": cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayNamespace"] error_map = { @@ -283,7 +283,7 @@ async def _create_or_update_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -303,7 +303,7 @@ async def begin_create_or_update( resource_group_name: str, namespace_name: str, parameters: "_models.RelayNamespace", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.RelayNamespace"]: """Create Azure Relay namespace. @@ -315,8 +315,8 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.relay.models.RelayNamespace :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either RelayNamespace or the result of cls(response) @@ -373,7 +373,7 @@ async def _delete_initial( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -406,7 +406,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -418,7 +418,7 @@ async def begin_delete( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes an existing namespace. This operation also removes all associated resources under the namespace. @@ -429,8 +429,8 @@ async def begin_delete( :type namespace_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -483,7 +483,7 @@ async def get( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> "_models.RelayNamespace": """Returns the description for the specified namespace. @@ -527,7 +527,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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RelayNamespace', pipeline_response) @@ -543,7 +543,7 @@ async def update( resource_group_name: str, namespace_name: str, parameters: "_models.RelayUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.RelayNamespace": """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -595,7 +595,7 @@ async def update( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -614,7 +614,7 @@ def list_authorization_rules( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Authorization rules for a namespace. @@ -674,7 +674,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -691,7 +691,7 @@ async def create_or_update_authorization_rule( namespace_name: str, authorization_rule_name: str, parameters: "_models.AuthorizationRule", - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Creates or updates an authorization rule for a namespace. @@ -745,7 +745,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -761,7 +761,7 @@ async def delete_authorization_rule( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a namespace authorization rule. @@ -808,7 +808,7 @@ async def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -821,7 +821,7 @@ async def get_authorization_rule( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Authorization rule for a namespace by name. @@ -868,7 +868,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -884,7 +884,7 @@ async def list_keys( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Primary and secondary connection strings to the namespace. @@ -931,7 +931,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -948,7 +948,7 @@ async def regenerate_keys( namespace_name: str, authorization_rule_name: str, parameters: "_models.RegenerateAccessKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Regenerates the primary or secondary connection strings to the namespace. @@ -1002,7 +1002,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py index 504e703d4197..ae7b426b5abd 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all available Relay REST API operations. @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py index 242f111fe9e5..495577abf105 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py @@ -45,7 +45,7 @@ def list_by_namespace( self, resource_group_name: str, namespace_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WcfRelaysListResult"]: """Lists the WCF relays within the namespace. @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -122,7 +122,7 @@ async def create_or_update( namespace_name: str, relay_name: str, parameters: "_models.WcfRelay", - **kwargs + **kwargs: Any ) -> "_models.WcfRelay": """Creates or updates a WCF relay. This operation is idempotent. @@ -176,7 +176,7 @@ async def create_or_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WcfRelay', pipeline_response) @@ -192,7 +192,7 @@ async def delete( resource_group_name: str, namespace_name: str, relay_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a WCF relay. @@ -239,7 +239,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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -252,7 +252,7 @@ async def get( resource_group_name: str, namespace_name: str, relay_name: str, - **kwargs + **kwargs: Any ) -> Optional["_models.WcfRelay"]: """Returns the description for the specified WCF relay. @@ -299,7 +299,7 @@ async def get( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -317,7 +317,7 @@ def list_authorization_rules( resource_group_name: str, namespace_name: str, relay_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Authorization rules for a WCF relay. @@ -397,7 +397,7 @@ async def create_or_update_authorization_rule( relay_name: str, authorization_rule_name: str, parameters: "_models.AuthorizationRule", - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Creates or updates an authorization rule for a WCF relay. @@ -454,7 +454,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -471,7 +471,7 @@ async def delete_authorization_rule( namespace_name: str, relay_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a WCF relay authorization rule. @@ -521,7 +521,7 @@ async def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -535,7 +535,7 @@ async def get_authorization_rule( namespace_name: str, relay_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AuthorizationRule": """Get authorizationRule for a WCF relay by name. @@ -585,7 +585,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -602,7 +602,7 @@ async def list_keys( namespace_name: str, relay_name: str, authorization_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Primary and secondary connection strings to the WCF relay. @@ -652,7 +652,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -670,7 +670,7 @@ async def regenerate_keys( relay_name: str, authorization_rule_name: str, parameters: "_models.RegenerateAccessKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Regenerates the primary or secondary connection strings to the WCF relay. @@ -727,7 +727,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py index 5ef1a6551e4b..1c63266d15fd 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py @@ -688,15 +688,15 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar name: Required. Name of this SKU. Default value: "Standard". + :ivar name: Name of this SKU. Has constant value: "Standard". :vartype name: str - :ivar tier: The tier of this SKU. Default value: "Standard". - :vartype tier: str + :param tier: The tier of this SKU. The only acceptable values to pass in are None and + "Standard". The default value is None. + :type tier: str """ _validation = { 'name': {'required': True, 'constant': True}, - 'tier': {'constant': True}, } _attribute_map = { @@ -705,13 +705,13 @@ class Sku(msrest.serialization.Model): } name = "Standard" - tier = "Standard" def __init__( self, **kwargs ): super(Sku, self).__init__(**kwargs) + self.tier = kwargs.get('tier', None) class WcfRelay(Resource): diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py index 48cdcd8c783e..03221951b2dd 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py @@ -737,15 +737,15 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar name: Required. Name of this SKU. Default value: "Standard". + :ivar name: Name of this SKU. Has constant value: "Standard". :vartype name: str - :ivar tier: The tier of this SKU. Default value: "Standard". - :vartype tier: str + :param tier: The tier of this SKU. The only acceptable values to pass in are None and + "Standard". The default value is None. + :type tier: str """ _validation = { 'name': {'required': True, 'constant': True}, - 'tier': {'constant': True}, } _attribute_map = { @@ -754,13 +754,15 @@ class Sku(msrest.serialization.Model): } name = "Standard" - tier = "Standard" def __init__( self, + *, + tier: Optional[str] = None, **kwargs ): super(Sku, self).__init__(**kwargs) + self.tier = tier class WcfRelay(Resource): diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py index 75144c17f0f3..19037210fe16 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -182,7 +182,7 @@ def create_or_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HybridConnection', pipeline_response) @@ -246,7 +246,7 @@ 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -307,7 +307,7 @@ 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HybridConnection', pipeline_response) @@ -387,7 +387,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -463,7 +463,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -531,7 +531,7 @@ def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -596,7 +596,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -664,7 +664,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -740,7 +740,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py index 6a42ed83120b..5da271a25902 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py @@ -96,7 +96,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -164,7 +164,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -236,7 +236,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -291,7 +291,7 @@ def _create_or_update_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -324,8 +324,8 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.relay.models.RelayNamespace :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either RelayNamespace or the result of cls(response) @@ -416,7 +416,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -440,8 +440,8 @@ def begin_delete( :type namespace_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -539,7 +539,7 @@ 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RelayNamespace', pipeline_response) @@ -608,7 +608,7 @@ def update( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -688,7 +688,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -760,7 +760,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -824,7 +824,7 @@ def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -885,7 +885,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -949,7 +949,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -1021,7 +1021,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py index 7c0dfdd28b4e..62feb3749fb8 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py index 90c3ace7d3bf..b3f42d45e81d 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -182,7 +182,7 @@ def create_or_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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WcfRelay', pipeline_response) @@ -246,7 +246,7 @@ 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -307,7 +307,7 @@ def get( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -464,7 +464,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -532,7 +532,7 @@ def delete_authorization_rule( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -597,7 +597,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -665,7 +665,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -741,7 +741,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response)