diff --git a/sdk/communication/azure-mgmt-communication/MANIFEST.in b/sdk/communication/azure-mgmt-communication/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/communication/azure-mgmt-communication/MANIFEST.in +++ b/sdk/communication/azure-mgmt-communication/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/communication/azure-mgmt-communication/_meta.json b/sdk/communication/azure-mgmt-communication/_meta.json new file mode 100644 index 000000000000..b45c869786c6 --- /dev/null +++ b/sdk/communication/azure-mgmt-communication/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "754938e4cb9416358b02dcc11f444adf14b3b7b6", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/communication/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/communication/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_communication_service_management_client.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_communication_service_management_client.py index 98c6538d3be8..06f31ee1be6a 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_communication_service_management_client.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_communication_service_management_client.py @@ -16,11 +16,11 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import CommunicationServiceManagementClientConfiguration from .operations import Operations from .operations import CommunicationServiceOperations -from .operations import OperationStatusesOperations from . import models @@ -31,8 +31,6 @@ class CommunicationServiceManagementClient(object): :vartype operations: communication_service_management_client.operations.Operations :ivar communication_service: CommunicationServiceOperations operations :vartype communication_service: communication_service_management_client.operations.CommunicationServiceOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: communication_service_management_client.operations.OperationStatusesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -63,8 +61,24 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.communication_service = CommunicationServiceOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations( - 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', min_length=1), + } + 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 diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_metadata.json b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_metadata.json index 26090e12d418..b778a7989a47 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_metadata.json +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "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\": [\"CommunicationServiceManagementClientConfiguration\"]}}, \"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\": [\"CommunicationServiceManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "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, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,22 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "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 + "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", - "communication_service": "CommunicationServiceOperations", - "operation_statuses": "OperationStatusesOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + "communication_service": "CommunicationServiceOperations" + } } \ No newline at end of file diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_version.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_version.py index 961c76eb77c1..c47f66669f1b 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_version.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.1" +VERSION = "1.0.0" diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/_communication_service_management_client.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/_communication_service_management_client.py index daa027cf4da5..3b4aa5a4bc01 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/_communication_service_management_client.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/_communication_service_management_client.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 @@ -18,7 +19,6 @@ from ._configuration import CommunicationServiceManagementClientConfiguration from .operations import Operations from .operations import CommunicationServiceOperations -from .operations import OperationStatusesOperations from .. import models @@ -29,8 +29,6 @@ class CommunicationServiceManagementClient(object): :vartype operations: communication_service_management_client.aio.operations.Operations :ivar communication_service: CommunicationServiceOperations operations :vartype communication_service: communication_service_management_client.aio.operations.CommunicationServiceOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: communication_service_management_client.aio.operations.OperationStatusesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -60,8 +58,23 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.communication_service = CommunicationServiceOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations( - 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', min_length=1), + } + 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/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/__init__.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/__init__.py index 0e6c216d6400..0a595e4791cd 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/__init__.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/__init__.py @@ -8,10 +8,8 @@ from ._operations import Operations from ._communication_service_operations import CommunicationServiceOperations -from ._operation_statuses_operations import OperationStatusesOperations __all__ = [ 'Operations', 'CommunicationServiceOperations', - 'OperationStatusesOperations', ] diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_communication_service_operations.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_communication_service_operations.py index 5abff16a6791..75f7bf37ae4f 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_communication_service_operations.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_communication_service_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, name_availability_parameters: Optional["_models.NameAvailabilityParameters"] = None, - **kwargs + **kwargs: Any ) -> "_models.NameAvailability": """Check Name Availability. @@ -96,7 +96,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('NameAvailability', pipeline_response) @@ -112,7 +112,7 @@ async def link_notification_hub( resource_group_name: str, communication_service_name: str, link_notification_hub_parameters: Optional["_models.LinkNotificationHubParameters"] = None, - **kwargs + **kwargs: Any ) -> "_models.LinkedNotificationHub": """Link Notification Hub. @@ -142,7 +142,7 @@ async def link_notification_hub( url = self.link_notification_hub.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -168,7 +168,7 @@ async def link_notification_hub( 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('LinkedNotificationHub', pipeline_response) @@ -181,7 +181,7 @@ async def link_notification_hub( def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.CommunicationServiceResourceList"]: """List By Subscription. @@ -237,7 +237,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) @@ -251,7 +251,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.CommunicationServiceResourceList"]: """List By Resource Group. @@ -282,7 +282,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -310,7 +310,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) @@ -326,7 +326,7 @@ async def update( resource_group_name: str, communication_service_name: str, parameters: Optional["_models.CommunicationServiceResource"] = None, - **kwargs + **kwargs: Any ) -> "_models.CommunicationServiceResource": """Update. @@ -356,7 +356,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -382,7 +382,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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) @@ -397,7 +397,7 @@ async def get( self, resource_group_name: str, communication_service_name: str, - **kwargs + **kwargs: Any ) -> "_models.CommunicationServiceResource": """Get. @@ -424,7 +424,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -443,7 +443,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('CommunicationServiceResource', pipeline_response) @@ -459,7 +459,7 @@ async def _create_or_update_initial( resource_group_name: str, communication_service_name: str, parameters: Optional["_models.CommunicationServiceResource"] = None, - **kwargs + **kwargs: Any ) -> "_models.CommunicationServiceResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunicationServiceResource"] error_map = { @@ -474,7 +474,7 @@ async def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -500,7 +500,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) response_headers = {} @@ -522,7 +522,7 @@ async def begin_create_or_update( resource_group_name: str, communication_service_name: str, parameters: Optional["_models.CommunicationServiceResource"] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.CommunicationServiceResource"]: """Create Or Update. @@ -536,8 +536,8 @@ async def begin_create_or_update( :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :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 CommunicationServiceResource or the result of cls(response) @@ -572,7 +572,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } @@ -594,7 +594,7 @@ async def _delete_initial( self, resource_group_name: str, communication_service_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -608,7 +608,7 @@ async def _delete_initial( url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -627,7 +627,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) response_headers = {} @@ -643,7 +643,7 @@ async def begin_delete( self, resource_group_name: str, communication_service_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete. @@ -655,8 +655,8 @@ async def begin_delete( :type communication_service_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) @@ -687,7 +687,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } @@ -709,7 +709,7 @@ async def list_keys( self, resource_group_name: str, communication_service_name: str, - **kwargs + **kwargs: Any ) -> "_models.CommunicationServiceKeys": """List Keys. @@ -736,7 +736,7 @@ async def list_keys( url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -755,7 +755,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('CommunicationServiceKeys', pipeline_response) @@ -771,7 +771,7 @@ async def regenerate_key( resource_group_name: str, communication_service_name: str, parameters: "_models.RegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.CommunicationServiceKeys": """Regenerate Key. @@ -802,7 +802,7 @@ async def regenerate_key( url = self.regenerate_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -825,7 +825,7 @@ async def regenerate_key( 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('CommunicationServiceKeys', pipeline_response) diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_operations.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_operations.py index aaf2bb39694d..955fa730471a 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/aio/operations/_operations.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/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"]: """List Operations. @@ -95,7 +95,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/communication/azure-mgmt-communication/azure/mgmt/communication/models/__init__.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/__init__.py index 8485e0905ace..87bc0dedc26d 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/__init__.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/__init__.py @@ -21,7 +21,6 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult - from ._models_py3 import OperationStatus from ._models_py3 import RegenerateKeyParameters from ._models_py3 import Resource from ._models_py3 import SystemData @@ -41,7 +40,6 @@ from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore - from ._models import OperationStatus # type: ignore from ._models import RegenerateKeyParameters # type: ignore from ._models import Resource # type: ignore from ._models import SystemData # type: ignore @@ -53,7 +51,6 @@ KeyType, Origin, ProvisioningState, - Status, ) __all__ = [ @@ -71,7 +68,6 @@ 'Operation', 'OperationDisplay', 'OperationListResult', - 'OperationStatus', 'RegenerateKeyParameters', 'Resource', 'SystemData', @@ -81,5 +77,4 @@ 'KeyType', 'Origin', 'ProvisioningState', - 'Status', ] diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_communication_service_management_client_enums.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_communication_service_management_client_enums.py index f970f772a600..6cfd385f1f33 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_communication_service_management_client_enums.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_communication_service_management_client_enums.py @@ -70,14 +70,3 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" MOVING = "Moving" - -class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of the resource. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - DELETING = "Deleting" - MOVING = "Moving" diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models.py index 18183f315372..4102e63e006d 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models.py @@ -255,7 +255,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -426,8 +426,8 @@ class NameAvailabilityParameters(msrest.serialization.Model): :param type: Required. The resource type. Should be always "Microsoft.Communication/CommunicationServices". :type type: str - :param name: Required. The CommunicationService name to validate. e.g."my-CommunicationService- - name-here". + :param name: Required. The CommunicationService name to validate. + e.g."my-CommunicationService-name-here". :type name: str """ @@ -458,8 +458,8 @@ class Operation(msrest.serialization.Model): :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- - plane operations and "false" for ARM/control-plane operations. + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool :param display: Localized display information for this particular operation. :type display: ~communication_service_management_client.models.OperationDisplay @@ -573,61 +573,11 @@ def __init__( self.next_link = None -class OperationStatus(msrest.serialization.Model): - """The current status of an async operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified ID for the operation status. - :vartype id: str - :ivar status: Provisioning state of the resource. Possible values include: "Succeeded", - "Failed", "Canceled", "Creating", "Deleting", "Moving". - :vartype status: str or ~communication_service_management_client.models.Status - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar percent_complete: Percent of the operation that is complete. - :vartype percent_complete: float - :param error: The error object. - :type error: ~communication_service_management_client.models.ErrorDetail - """ - - _validation = { - 'id': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'percent_complete': {'readonly': True, 'maximum': 100, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, - 'error': {'key': 'error.error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = kwargs.get('error', None) - - class RegenerateKeyParameters(msrest.serialization.Model): """Parameters describes the request to regenerate access keys. - :param key_type: The keyType to regenerate. Must be either 'primary' or 'secondary'(case- - insensitive). Possible values include: "Primary", "Secondary". + :param key_type: The keyType to regenerate. Must be either 'primary' or + 'secondary'(case-insensitive). Possible values include: "Primary", "Secondary". :type key_type: str or ~communication_service_management_client.models.KeyType """ diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models_py3.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models_py3.py index 00376005cd4e..f6f3d3df6f2e 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models_py3.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/models/_models_py3.py @@ -276,7 +276,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -458,8 +458,8 @@ class NameAvailabilityParameters(msrest.serialization.Model): :param type: Required. The resource type. Should be always "Microsoft.Communication/CommunicationServices". :type type: str - :param name: Required. The CommunicationService name to validate. e.g."my-CommunicationService- - name-here". + :param name: Required. The CommunicationService name to validate. + e.g."my-CommunicationService-name-here". :type name: str """ @@ -493,8 +493,8 @@ class Operation(msrest.serialization.Model): :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data- - plane operations and "false" for ARM/control-plane operations. + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool :param display: Localized display information for this particular operation. :type display: ~communication_service_management_client.models.OperationDisplay @@ -610,63 +610,11 @@ def __init__( self.next_link = None -class OperationStatus(msrest.serialization.Model): - """The current status of an async operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified ID for the operation status. - :vartype id: str - :ivar status: Provisioning state of the resource. Possible values include: "Succeeded", - "Failed", "Canceled", "Creating", "Deleting", "Moving". - :vartype status: str or ~communication_service_management_client.models.Status - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar percent_complete: Percent of the operation that is complete. - :vartype percent_complete: float - :param error: The error object. - :type error: ~communication_service_management_client.models.ErrorDetail - """ - - _validation = { - 'id': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'percent_complete': {'readonly': True, 'maximum': 100, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'float'}, - 'error': {'key': 'error.error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = error - - class RegenerateKeyParameters(msrest.serialization.Model): """Parameters describes the request to regenerate access keys. - :param key_type: The keyType to regenerate. Must be either 'primary' or 'secondary'(case- - insensitive). Possible values include: "Primary", "Secondary". + :param key_type: The keyType to regenerate. Must be either 'primary' or + 'secondary'(case-insensitive). Possible values include: "Primary", "Secondary". :type key_type: str or ~communication_service_management_client.models.KeyType """ diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/__init__.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/__init__.py index 0e6c216d6400..0a595e4791cd 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/__init__.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/__init__.py @@ -8,10 +8,8 @@ from ._operations import Operations from ._communication_service_operations import CommunicationServiceOperations -from ._operation_statuses_operations import OperationStatusesOperations __all__ = [ 'Operations', 'CommunicationServiceOperations', - 'OperationStatusesOperations', ] diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_communication_service_operations.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_communication_service_operations.py index 7137e3adce1a..93cbea9b4319 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_communication_service_operations.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_communication_service_operations.py @@ -101,7 +101,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('NameAvailability', pipeline_response) @@ -148,7 +148,7 @@ def link_notification_hub( url = self.link_notification_hub.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -174,7 +174,7 @@ def link_notification_hub( 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('LinkedNotificationHub', pipeline_response) @@ -244,7 +244,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) @@ -290,7 +290,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -318,7 +318,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) @@ -365,7 +365,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -391,7 +391,7 @@ 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CommunicationServiceResource', pipeline_response) @@ -434,7 +434,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -453,7 +453,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('CommunicationServiceResource', pipeline_response) @@ -485,7 +485,7 @@ def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -511,7 +511,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) response_headers = {} @@ -548,8 +548,8 @@ def begin_create_or_update( :type parameters: ~communication_service_management_client.models.CommunicationServiceResource :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 CommunicationServiceResource or the result of cls(response) @@ -584,7 +584,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } @@ -621,7 +621,7 @@ def _delete_initial( url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -640,7 +640,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) response_headers = {} @@ -669,8 +669,8 @@ def begin_delete( :type communication_service_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) @@ -701,7 +701,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } @@ -751,7 +751,7 @@ def list_keys( url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -770,7 +770,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('CommunicationServiceKeys', pipeline_response) @@ -818,7 +818,7 @@ def regenerate_key( url = self.regenerate_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'communicationServiceName': self._serialize.url("communication_service_name", communication_service_name, 'str', max_length=63, min_length=1, pattern=r'^[-\w]+$'), } url = self._client.format_url(url, **path_format_arguments) @@ -841,7 +841,7 @@ def regenerate_key( 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('CommunicationServiceKeys', pipeline_response) diff --git a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_operations.py b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_operations.py index a8d25311b423..6833ff28d223 100644 --- a/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_operations.py +++ b/sdk/communication/azure-mgmt-communication/azure/mgmt/communication/operations/_operations.py @@ -100,7 +100,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)