From 324d51010ddcf04821d03f43b1457f6215e56c00 Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Mon, 22 May 2023 21:22:44 -0700 Subject: [PATCH 1/8] update autorest and remove non GA features --- .../communication/callautomation/__init__.py | 10 - .../callautomation/_call_automation_client.py | 82 +- .../callautomation/_call_connection_client.py | 125 +- .../callautomation/_generated/_client.py | 42 +- .../_generated/_configuration.py | 40 +- .../callautomation/_generated/aio/_client.py | 42 +- .../_generated/aio/_configuration.py | 40 +- .../_generated/aio/operations/_operations.py | 1510 ++-------- .../_generated/models/__init__.py | 58 - .../_generated/models/_enums.py | 45 +- .../_generated/models/_models.py | 2544 +++++------------ .../_generated/operations/_operations.py | 1595 ++--------- .../communication/callautomation/_models.py | 92 +- .../aio/_call_automation_client_async.py | 72 +- .../aio/_call_connection_client_async.py | 107 +- .../tests/test_call_media_client.py | 66 +- 16 files changed, 1311 insertions(+), 5159 deletions(-) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/__init__.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/__init__.py index bd1540a08cc6..c2340a4ec0ce 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/__init__.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/__init__.py @@ -17,7 +17,6 @@ AddParticipantResult, RemoveParticipantResult, TransferCallResult, - MediaStreamingConfiguration, ChannelAffinity ) from ._shared.models import ( @@ -35,11 +34,7 @@ RecordingContent, RecordingChannel, RecordingFormat, - RecordingStorage, RecognizeInputType, - MediaStreamingAudioChannelType, - MediaStreamingContentType, - MediaStreamingTransportType, DtmfTone, CallConnectionState, RecordingState @@ -63,7 +58,6 @@ "AddParticipantResult", "RemoveParticipantResult", "TransferCallResult", - "MediaStreamingConfiguration", # common ACS communication identifier "CommunicationIdentifier", @@ -80,11 +74,7 @@ "RecordingContent", "RecordingChannel", "RecordingFormat", - "RecordingStorage", "RecognizeInputType", - "MediaStreamingAudioChannelType", - "MediaStreamingContentType", - "MediaStreamingTransportType", "DtmfTone", "CallConnectionState", "RecordingState" diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py index 630b7533d547..a6ebd6953ac7 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py @@ -19,8 +19,7 @@ AnswerCallRequest, RedirectCallRequest, RejectCallRequest, - StartCallRecordingRequest, - CustomContext + StartCallRecordingRequest ) from ._models import ( CallConnectionProperties, @@ -38,8 +37,7 @@ from ._models import ( CallInvite, ServerCallLocator, - GroupCallLocator, - MediaStreamingConfiguration + GroupCallLocator ) from azure.core.credentials import ( TokenCredential, @@ -54,8 +52,7 @@ CallRejectReason, RecordingContent, RecordingChannel, - RecordingFormat, - RecordingStorage + RecordingFormat ) from azure.core.exceptions import HttpResponseError @@ -97,12 +94,18 @@ def __init__( if not parsed_url.netloc: raise ValueError(f"Invalid URL: {format(endpoint)}") + # self._client = AzureCommunicationCallAutomationService( + # endpoint, + # api_version=api_version or DEFAULT_VERSION, + # authentication_policy=get_authentication_policy( + # endpoint, credential), + # sdk_moniker=SDK_MONIKER, + # **kwargs) + self._client = AzureCommunicationCallAutomationService( endpoint, api_version=api_version or DEFAULT_VERSION, - authentication_policy=get_authentication_policy( - endpoint, credential), - sdk_moniker=SDK_MONIKER, + credential=credential, **kwargs) self._call_recording_client = self._client.call_recording @@ -155,8 +158,6 @@ def create_call( callback_url: str, *, operation_context: Optional[str] = None, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, **kwargs ) -> CallConnectionProperties: """Create a call connection request to a target identity. @@ -167,19 +168,10 @@ def create_call( :type callback_url: str :keyword operation_context: Value that can be used to track the call and its associated events. :paramtype operation_context: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The identifier of the Cognitive Service resource assigned to this call. - :paramtype azure_cognitive_services_endpoint_url: str :return: CallConnectionProperties :rtype: ~azure.communication.callautomation.CallConnectionProperties :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None create_call_request = CreateCallRequest( targets=[serialize_identifier(target_participant.target)], callback_uri=callback_url, @@ -189,10 +181,6 @@ def create_call( source_identity=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, - custom_context=user_custom_context ) result = self._client.create_call( @@ -213,10 +201,6 @@ def create_group_call( source_caller_id_number: Optional['PhoneNumberIdentifier'] = None, source_display_name: Optional[str] = None, operation_context: Optional[str] = None, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, - sip_headers: Optional[Dict[str, str]] = None, - voip_headers: Optional[Dict[str, str]] = None, **kwargs ) -> CallConnectionProperties: """Create a call connection request to a list of multiple target identities. @@ -234,22 +218,10 @@ def create_group_call( :paramtype source_display_name: str :keyword operation_context: Value that can be used to track the call and its associated events. :paramtype operation_context: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The identifier of the Cognitive Service resource assigned to this call. - :paramtype azure_cognitive_services_endpoint_url: str - :keyword sip_headers: Sip Headers for PSTN Call - :paramtype sip_headers: Dict[str, str] - :keyword voip_headers: Voip Headers for Voip Call - :paramtype voip_headers: Dict[str, str] :return: CallConnectionProperties :rtype: ~azure.communication.callautomation.CallConnectionProperties :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=voip_headers, sip_headers=sip_headers) if sip_headers or voip_headers else None - create_call_request = CreateCallRequest( targets=[serialize_identifier(identifier) for identifier in target_participants], @@ -260,10 +232,6 @@ def create_group_call( source_identity=serialize_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, - custom_context=user_custom_context, ) result = self._client.create_call( @@ -281,8 +249,6 @@ def answer_call( incoming_call_context: str, callback_url: str, *, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, operation_context: Optional[str] = None, **kwargs ) -> CallConnectionProperties: @@ -294,11 +260,6 @@ def answer_call( :type incoming_call_context: str :param callback_url: The call back url for receiving events. :type callback_url: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The endpoint url of the Azure Cognitive Services resource attached. - :paramtype azure_cognitive_services_endpoint_url: str :keyword operation_context: The operation context. :paramtype operation_context: str :return: CallConnectionProperties @@ -308,9 +269,6 @@ def answer_call( answer_call_request = AnswerCallRequest( incoming_call_context=incoming_call_context, callback_uri=callback_url, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, answered_by_identifier=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context @@ -343,15 +301,9 @@ def redirect_call( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None - redirect_call_request = RedirectCallRequest( incoming_call_context=incoming_call_context, target=serialize_identifier(target_participant.target), - custom_context=user_custom_context ) self._client.redirect_call( @@ -400,9 +352,7 @@ def start_recording( recording_channel_type: Optional[Union[str, 'RecordingChannel']] = None, recording_format_type: Optional[Union[str, 'RecordingFormat']] = None, audio_channel_participant_ordering: Optional[List['CommunicationIdentifier']] = None, - recording_storage_type: Optional[Union[str, 'RecordingStorage']] = None, channel_affinity: Optional[List['ChannelAffinity']] = None, - external_storage_location: Optional[str] = None, **kwargs ) -> RecordingProperties: """Start recording for a ongoing call. Locate the call with call locator. @@ -425,17 +375,11 @@ def start_recording( which participant first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. :paramtype audio_channel_participant_ordering: list[~azure.communication.callautomation.CommunicationIdentifier] - :keyword recording_storage_type: Recording storage mode. - ``External`` enables bring your own storage. - :paramtype recording_storage_type: str :keyword channel_affinity: The channel affinity of call recording When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned. Channel-Participant mapping details can be found in the metadata of the recording. :paramtype channel_affinity: list[~azure.communication.callautomation.ChannelAffinity] - :keyword external_storage_location: The location where recording is stored, - when RecordingStorageType is set to 'BlobStorage'. - :paramtype external_storage_location: str or ~azure.communication.callautomation.RecordingStorage :return: RecordingProperties :rtype: ~azure.communication.callautomation.RecordingProperties :raises ~azure.core.exceptions.HttpResponseError: @@ -455,8 +399,6 @@ def start_recording( recording_channel_type = recording_channel_type, recording_format_type = recording_format_type, audio_channel_participant_ordering = audio_channel_participant_ordering, - recording_storage_type = recording_storage_type, - external_storage_location = external_storage_location, channel_affinity = channel_affinity_internal, repeatability_first_sent=get_repeatability_timestamp(), repeatability_request_id=get_repeatability_guid() diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py index e3bf0e834a6e..9a8221ee7a49 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py @@ -29,9 +29,6 @@ TransferToParticipantRequest, PlayRequest, RecognizeRequest, - ContinuousDtmfRecognitionRequest, - SendDtmfRequest, - CustomContext, DtmfOptions, PlayOptions, RecognizeOptions, @@ -92,13 +89,20 @@ def __init__(# pylint: disable=missing-client-constructor-parameter-credential, parsed_url = urlparse(endpoint.rstrip('/')) if not parsed_url.netloc: raise ValueError(f"Invalid URL: {format(endpoint)}") + # self._client = AzureCommunicationCallAutomationService( + # endpoint, + # api_version=api_version or DEFAULT_VERSION, + # authentication_policy=get_authentication_policy( + # endpoint, credential), + # sdk_moniker=SDK_MONIKER, + # **kwargs) + self._client = AzureCommunicationCallAutomationService( - endpoint, + endpoint=endpoint, + credential=credential, api_version=api_version or DEFAULT_VERSION, - authentication_policy=get_authentication_policy( - endpoint, credential), - sdk_moniker=SDK_MONIKER, - **kwargs) + **kwargs + ) self._call_connection_id = call_connection_id self._call_connection_client = self._client.call_connection @@ -194,15 +198,13 @@ def list_participants(self, **kwargs) -> ItemPaged[CallParticipant]: :rtype: ItemPaged[azure.communication.callautomation.CallParticipant] :raises ~azure.core.exceptions.HttpResponseError: """ - return self._call_connection_client.get_participants(self._call_connection_id, **kwargs).values + return self._call_connection_client.get_participants(self._call_connection_id, **kwargs) @distributed_trace def transfer_call_to_participant( self, target_participant: 'CommunicationIdentifier', *, - sip_headers: Optional[Dict[str, str]] = None, - voip_headers: Optional[Dict[str, str]] = None, operation_context: Optional[str] = None, **kwargs ) -> TransferCallResult: @@ -210,23 +212,14 @@ def transfer_call_to_participant( :param target_participant: The transfer target. :type target_participant: CommunicationIdentifier - :keyword sip_headers: Custom context for PSTN - :paramtype sip_headers: dict[str, str] - :keyword voip_headers: Custom context for VOIP - :paramtype voip_headers: dict[str, str] :keyword operation_context: Value that can be used to track this call and its associated events. :paramtype operation_context: str :return: TransferCallResult :rtype: ~azure.communication.callautomation.TransferCallResult :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=voip_headers, - sip_headers=sip_headers - ) if sip_headers or voip_headers else None request = TransferToParticipantRequest( - target_participant=serialize_identifier(target_participant), - custom_context=user_custom_context, operation_context=operation_context) + target_participant=serialize_identifier(target_participant), operation_context=operation_context) return self._call_connection_client.transfer_to_participant( self._call_connection_id, request, @@ -256,16 +249,11 @@ def add_participant( :rtype: ~azure.communication.callautomation.AddParticipantResult :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None add_participant_request = AddParticipantRequest( participant_to_add=serialize_identifier(target_participant.target), source_caller_id_number=serialize_phone_identifier( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, - custom_context=user_custom_context, invitation_timeout=invitation_timeout, operation_context=operation_context) @@ -449,88 +437,3 @@ def cancel_all_media_operations( """ self._call_media_client.cancel_all_media_operations( self._call_connection_id, **kwargs) - - @distributed_trace - def start_continuous_dtmf_recognition( - self, - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: The value to identify context of the operation. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - self._call_media_client.start_continuous_dtmf_recognition( - self._call_connection_id, - continuous_dtmf_recognition_request, - **kwargs) - - @distributed_trace - def stop_continuous_dtmf_recognition( - self, - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: The value to identify context of the operation. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - self._call_media_client.stop_continuous_dtmf_recognition( - self._call_connection_id, - continuous_dtmf_recognition_request, - **kwargs) - - @distributed_trace - def send_dtmf( - self, - tones: List[Union[str, 'DtmfTone']], - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """Send Dtmf tones to this call. - - :param tones: List of tones to be sent to target participant. - :type tones:list[str or ~azure.communication.callautomation.DtmfTone] - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: The value to identify context of the operation. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - send_dtmf_request = SendDtmfRequest( - tones=tones, - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - self._call_media_client.send_dtmf( - self._call_connection_id, - send_dtmf_request, - **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py index 45a30566a09d..96919fa20ed5 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any +import datetime +from typing import Any, Optional from azure.core import PipelineClient +from azure.core.credentials import AzureKeyCredential from azure.core.rest import HttpRequest, HttpResponse from . import models as _models @@ -37,19 +39,45 @@ class AzureCommunicationCallAutomationService( :vartype call_recording: azure.communication.callautomation.operations.CallRecordingOperations :param endpoint: The endpoint of the Azure Communication resource. Required. :type endpoint: str - :keyword api_version: Api Version. Default value is "2023-01-15-preview". Note that overriding - this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :type repeatability_request_id: str + :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :type repeatability_first_sent: ~datetime.datetime + :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, **kwargs: Any + def __init__( + self, + endpoint: str, + credential: AzureKeyCredential, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - self._config = AzureCommunicationCallAutomationServiceConfiguration(endpoint=endpoint, **kwargs) + self._config = AzureCommunicationCallAutomationServiceConfiguration( + endpoint=endpoint, + credential=credential, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, + **kwargs + ) self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)} + client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)}) self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py index 26c66510ca4d..6637289ee4fa 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py @@ -6,9 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +import datetime +from typing import Any, Optional from azure.core.configuration import Configuration +from azure.core.credentials import AzureKeyCredential from azure.core.pipeline import policies VERSION = "unknown" @@ -24,19 +26,45 @@ class AzureCommunicationCallAutomationServiceConfiguration( :param endpoint: The endpoint of the Azure Communication resource. Required. :type endpoint: str - :keyword api_version: Api Version. Default value is "2023-01-15-preview". Note that overriding - this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :type repeatability_request_id: str + :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :type repeatability_first_sent: ~datetime.datetime + :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, **kwargs: Any) -> None: + def __init__( + self, + endpoint: str, + credential: AzureKeyCredential, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: super(AzureCommunicationCallAutomationServiceConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-01-15-preview") + api_version: str = kwargs.pop("api_version", "2023-03-06") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") self.endpoint = endpoint + self.credential = credential + self.repeatability_request_id = repeatability_request_id + self.repeatability_first_sent = repeatability_first_sent self.api_version = api_version kwargs.setdefault("sdk_moniker", "communication-callautomation/{}".format(VERSION)) self._configure(**kwargs) @@ -51,3 +79,5 @@ def _configure(self, **kwargs: Any) -> None: self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AzureKeyCredentialPolicy(self.credential, "Authorization", **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py index 340ee54e286f..d589322e714a 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable +import datetime +from typing import Any, Awaitable, Optional from azure.core import AsyncPipelineClient +from azure.core.credentials import AzureKeyCredential from azure.core.rest import AsyncHttpResponse, HttpRequest from .. import models as _models @@ -38,19 +40,45 @@ class AzureCommunicationCallAutomationService( azure.communication.callautomation.aio.operations.CallRecordingOperations :param endpoint: The endpoint of the Azure Communication resource. Required. :type endpoint: str - :keyword api_version: Api Version. Default value is "2023-01-15-preview". Note that overriding - this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :type repeatability_request_id: str + :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :type repeatability_first_sent: ~datetime.datetime + :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, **kwargs: Any + def __init__( + self, + endpoint: str, + credential: AzureKeyCredential, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - self._config = AzureCommunicationCallAutomationServiceConfiguration(endpoint=endpoint, **kwargs) + self._config = AzureCommunicationCallAutomationServiceConfiguration( + endpoint=endpoint, + credential=credential, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, + **kwargs + ) self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)} + client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)}) self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py index 3c824b8b0668..eafe60f62c7f 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py @@ -6,9 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +import datetime +from typing import Any, Optional from azure.core.configuration import Configuration +from azure.core.credentials import AzureKeyCredential from azure.core.pipeline import policies VERSION = "unknown" @@ -24,19 +26,45 @@ class AzureCommunicationCallAutomationServiceConfiguration( :param endpoint: The endpoint of the Azure Communication resource. Required. :type endpoint: str - :keyword api_version: Api Version. Default value is "2023-01-15-preview". Note that overriding - this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :type repeatability_request_id: str + :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :type repeatability_first_sent: ~datetime.datetime + :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, **kwargs: Any) -> None: + def __init__( + self, + endpoint: str, + credential: AzureKeyCredential, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: super(AzureCommunicationCallAutomationServiceConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-01-15-preview") + api_version: str = kwargs.pop("api_version", "2023-03-06") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") self.endpoint = endpoint + self.credential = credential + self.repeatability_request_id = repeatability_request_id + self.repeatability_first_sent = repeatability_first_sent self.api_version = api_version kwargs.setdefault("sdk_moniker", "communication-callautomation/{}".format(VERSION)) self._configure(**kwargs) @@ -51,3 +79,5 @@ def _configure(self, **kwargs: Any) -> None: self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AzureKeyCredentialPolicy(self.credential, "Authorization", **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py index 4bc2388b15f6..55645f953ba7 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py @@ -7,8 +7,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,6 +22,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -34,17 +37,12 @@ build_call_connection_get_participant_request, build_call_connection_get_participants_request, build_call_connection_hangup_call_request, - build_call_connection_mute_request, build_call_connection_remove_participant_request, build_call_connection_terminate_call_request, build_call_connection_transfer_to_participant_request, - build_call_connection_unmute_request, build_call_media_cancel_all_media_operations_request, build_call_media_play_request, build_call_media_recognize_request, - build_call_media_send_dtmf_request, - build_call_media_start_continuous_dtmf_recognition_request, - build_call_media_stop_continuous_dtmf_recognition_request, build_call_recording_get_recording_properties_request, build_call_recording_pause_recording_request, build_call_recording_resume_recording_request, @@ -60,13 +58,7 @@ class AzureCommunicationCallAutomationServiceOperationsMixin(AzureCommunicationCallAutomationServiceMixinABC): @overload async def create_call( - self, - create_call_request: _models.CreateCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, create_call_request: _models.CreateCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -74,18 +66,6 @@ async def create_call( :param create_call_request: The create call request. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -96,13 +76,7 @@ async def create_call( @overload async def create_call( - self, - create_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, create_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -110,18 +84,6 @@ async def create_call( :param create_call_request: The create call request. Required. :type create_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -132,12 +94,7 @@ async def create_call( @distributed_trace_async async def create_call( - self, - create_call_request: Union[_models.CreateCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, create_call_request: Union[_models.CreateCallRequest, IO], **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -146,18 +103,6 @@ async def create_call( :param create_call_request: The create call request. Is either a CreateCallRequest type or a IO type. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -188,8 +133,8 @@ async def create_call( _json = self._serialize.body(create_call_request, "CreateCallRequest") request = build_azure_communication_call_automation_service_create_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -223,13 +168,7 @@ async def create_call( @overload async def answer_call( - self, - answer_call_request: _models.AnswerCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, answer_call_request: _models.AnswerCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -237,18 +176,6 @@ async def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -259,13 +186,7 @@ async def answer_call( @overload async def answer_call( - self, - answer_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, answer_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -273,18 +194,6 @@ async def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -295,12 +204,7 @@ async def answer_call( @distributed_trace_async async def answer_call( - self, - answer_call_request: Union[_models.AnswerCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, answer_call_request: Union[_models.AnswerCallRequest, IO], **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -309,18 +213,6 @@ async def answer_call( :param answer_call_request: The answer call request. Is either a AnswerCallRequest type or a IO type. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -351,8 +243,8 @@ async def answer_call( _json = self._serialize.body(answer_call_request, "AnswerCallRequest") request = build_azure_communication_call_automation_service_answer_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -389,8 +281,6 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements self, redirect_call_request: _models.RedirectCallRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> None: @@ -400,18 +290,6 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -422,13 +300,7 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @overload async def redirect_call( # pylint: disable=inconsistent-return-statements - self, - redirect_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, redirect_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Redirect a call. @@ -436,18 +308,6 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -458,12 +318,7 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def redirect_call( # pylint: disable=inconsistent-return-statements - self, - redirect_call_request: Union[_models.RedirectCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, redirect_call_request: Union[_models.RedirectCallRequest, IO], **kwargs: Any ) -> None: """Redirect a call. @@ -473,18 +328,6 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements or a IO type. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -515,8 +358,8 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(redirect_call_request, "RedirectCallRequest") request = build_azure_communication_call_automation_service_redirect_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -546,13 +389,7 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @overload async def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: _models.RejectCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, reject_call_request: _models.RejectCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Reject the call. @@ -560,18 +397,6 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -582,13 +407,7 @@ async def reject_call( # pylint: disable=inconsistent-return-statements @overload async def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, reject_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Reject the call. @@ -596,18 +415,6 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -618,12 +425,7 @@ async def reject_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: Union[_models.RejectCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, reject_call_request: Union[_models.RejectCallRequest, IO], **kwargs: Any ) -> None: """Reject the call. @@ -632,18 +434,6 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Is either a RejectCallRequest type or a IO type. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -674,8 +464,8 @@ async def reject_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(reject_call_request, "RejectCallRequest") request = build_azure_communication_call_automation_service_reject_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -725,9 +515,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.CallConnectionProperties: - """Get call connection. + """Get the detail properties of an ongoing call. - Get call connection. + Get the detail properties of an ongoing call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -782,9 +572,11 @@ async def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.Call async def hangup_call( # pylint: disable=inconsistent-return-statements self, call_connection_id: str, **kwargs: Any ) -> None: - """Hangup the call. + """Hang up call automation service from the call. This will make call automation service leave the + call, but does not terminate if there are more than 1 caller in the call. - Hangup the call. + Hang up call automation service from the call. This will make call automation service leave the + call, but does not terminate if there are more than 1 caller in the call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -833,12 +625,7 @@ async def hangup_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def terminate_call( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, call_connection_id: str, **kwargs: Any ) -> None: """Terminate a call using CallConnectionId. @@ -846,18 +633,6 @@ async def terminate_call( # pylint: disable=inconsistent-return-statements :param call_connection_id: The terminate call request. Required. :type call_connection_id: str - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -877,8 +652,8 @@ async def terminate_call( # pylint: disable=inconsistent-return-statements request = build_call_connection_terminate_call_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, api_version=self._config.api_version, headers=_headers, params=_params, @@ -909,8 +684,6 @@ async def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: _models.TransferToParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -923,18 +696,6 @@ async def transfer_to_participant( :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -949,8 +710,6 @@ async def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -962,18 +721,6 @@ async def transfer_to_participant( :type call_connection_id: str :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -987,9 +734,6 @@ async def transfer_to_participant( self, call_connection_id: str, transfer_to_participant_request: Union[_models.TransferToParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, **kwargs: Any ) -> _models.TransferCallResponse: """Transfer the call to a participant. @@ -1002,18 +746,6 @@ async def transfer_to_participant( TransferToParticipantRequest type or a IO type. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1045,8 +777,8 @@ async def transfer_to_participant( request = build_call_connection_transfer_to_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1078,18 +810,26 @@ async def transfer_to_participant( return deserialized - @distributed_trace_async - async def get_participants(self, call_connection_id: str, **kwargs: Any) -> _models.GetParticipantsResponse: + @distributed_trace + def get_participants(self, call_connection_id: str, **kwargs: Any) -> AsyncIterable["_models.CallParticipant"]: """Get participants from a call. Get participants from a call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str - :return: GetParticipantsResponse - :rtype: ~azure.communication.callautomation.models.GetParticipantsResponse + :return: An iterator like instance of CallParticipant + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.communication.callautomation.models.CallParticipant] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.GetParticipantsResponse] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1098,40 +838,70 @@ async def get_participants(self, call_connection_id: str, **kwargs: Any) -> _mod } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.GetParticipantsResponse] = kwargs.pop("cls", None) - - request = build_call_connection_get_participants_request( - call_connection_id=call_connection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize("GetParticipantsResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + def prepare_request(next_link=None): + if not next_link: + + request = build_call_connection_get_participants_request( + call_connection_id=call_connection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.GetParticipantsResponse, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @overload async def add_participant( @@ -1139,31 +909,17 @@ async def add_participant( call_connection_id: str, add_participant_request: _models.AddParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1178,31 +934,17 @@ async def add_participant( call_connection_id: str, add_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1213,35 +955,17 @@ async def add_participant( @distributed_trace_async async def add_participant( - self, - call_connection_id: str, - add_participant_request: Union[_models.AddParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, call_connection_id: str, add_participant_request: Union[_models.AddParticipantRequest, IO], **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Is either a AddParticipantRequest type or a IO type. Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1273,8 +997,8 @@ async def add_participant( request = build_call_connection_add_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1312,32 +1036,18 @@ async def remove_participant( call_connection_id: str, remove_participant_request: _models.RemoveParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1352,31 +1062,17 @@ async def remove_participant( call_connection_id: str, remove_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1390,14 +1086,11 @@ async def remove_participant( self, call_connection_id: str, remove_participant_request: Union[_models.RemoveParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -1405,18 +1098,6 @@ async def remove_participant( RemoveParticipantRequest type or a IO type. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1448,8 +1129,8 @@ async def remove_participant( request = build_call_connection_remove_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1481,122 +1162,20 @@ async def remove_participant( return deserialized - @overload - async def mute( - self, - call_connection_id: str, - mute_participants_request: _models.MuteParticipantsRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. - - Mute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Required. - :type mute_participants_request: - ~azure.communication.callautomation.models.MuteParticipantsRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def mute( - self, - call_connection_id: str, - mute_participants_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. - - Mute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Required. - :type mute_participants_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def mute( - self, - call_connection_id: str, - mute_participants_request: Union[_models.MuteParticipantsRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. + async def get_participant( + self, call_connection_id: str, participant_raw_id: str, **kwargs: Any + ) -> _models.CallParticipant: + """Get participant from a call. - Mute participants from the call using identifier. + Get participant from a call. - :param call_connection_id: The call connection id. Required. + :param call_connection_id: The call connection Id. Required. :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Is either a - MuteParticipantsRequest type or a IO type. Required. - :type mute_participants_request: - ~azure.communication.callautomation.models.MuteParticipantsRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse + :param participant_raw_id: Raw id of the participant to retrieve. Required. + :type participant_raw_id: str + :return: CallParticipant + :rtype: ~azure.communication.callautomation.models.CallParticipant :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1607,28 +1186,15 @@ async def mute( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MuteParticipantsResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mute_participants_request, (IOBase, bytes)): - _content = mute_participants_request - else: - _json = self._serialize.body(mute_participants_request, "MuteParticipantsRequest") + cls: ClsType[_models.CallParticipant] = kwargs.pop("cls", None) - request = build_call_connection_mute_request( + request = build_call_connection_get_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, - content_type=content_type, + participant_raw_id=participant_raw_id, api_version=self._config.api_version, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -1644,134 +1210,100 @@ async def mute( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) - deserialized = self._deserialize("MuteParticipantsResponse", pipeline_response) + deserialized = self._deserialize("CallParticipant", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized + +class CallMediaOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.communication.callautomation.aio.AzureCommunicationCallAutomationService`'s + :attr:`call_media` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - async def unmute( + async def play( # pylint: disable=inconsistent-return-statements self, call_connection_id: str, - unmute_participants_request: _models.UnmuteParticipantsRequest, + play_request: _models.PlayRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. + ) -> None: + """Plays audio to participants in the call. - Unmute participants from the call using identifier. + Plays audio to participants in the call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Required. - :type unmute_participants_request: - ~azure.communication.callautomation.models.UnmuteParticipantsRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str + :param play_request: play request payload. Required. + :type play_request: ~azure.communication.callautomation.models.PlayRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def unmute( - self, - call_connection_id: str, - unmute_participants_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. + async def play( # pylint: disable=inconsistent-return-statements + self, call_connection_id: str, play_request: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Plays audio to participants in the call. - Unmute participants from the call using identifier. + Plays audio to participants in the call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Required. - :type unmute_participants_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str + :param play_request: play request payload. Required. + :type play_request: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def unmute( - self, - call_connection_id: str, - unmute_participants_request: Union[_models.UnmuteParticipantsRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. + async def play( # pylint: disable=inconsistent-return-statements + self, call_connection_id: str, play_request: Union[_models.PlayRequest, IO], **kwargs: Any + ) -> None: + """Plays audio to participants in the call. - Unmute participants from the call using identifier. + Plays audio to participants in the call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Is either a - UnmuteParticipantsRequest type or a IO type. Required. - :type unmute_participants_request: - ~azure.communication.callautomation.models.UnmuteParticipantsRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str + :param play_request: play request payload. Is either a PlayRequest type or a IO type. Required. + :type play_request: ~azure.communication.callautomation.models.PlayRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1786,20 +1318,18 @@ async def unmute( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnmuteParticipantsResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(unmute_participants_request, (IOBase, bytes)): - _content = unmute_participants_request + if isinstance(play_request, (IOBase, bytes)): + _content = play_request else: - _json = self._serialize.body(unmute_participants_request, "UnmuteParticipantsRequest") + _json = self._serialize.body(play_request, "PlayRequest") - request = build_call_connection_unmute_request( + request = build_call_media_play_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1824,27 +1354,21 @@ async def unmute( error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) - deserialized = self._deserialize("UnmuteParticipantsResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, None, {}) @distributed_trace_async - async def get_participant( - self, call_connection_id: str, participant_raw_id: str, **kwargs: Any - ) -> _models.CallParticipant: - """Get participant from a call. + async def cancel_all_media_operations( # pylint: disable=inconsistent-return-statements + self, call_connection_id: str, **kwargs: Any + ) -> None: + """Cancel all media operations in a call. - Get participant from a call. + Cancel all media operations in a call. - :param call_connection_id: The call connection Id. Required. + :param call_connection_id: The call connection id. Required. :type call_connection_id: str - :param participant_raw_id: Raw id of the participant to retrieve. Required. - :type participant_raw_id: str - :return: CallParticipant - :rtype: ~azure.communication.callautomation.models.CallParticipant + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -1858,11 +1382,10 @@ async def get_participant( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CallParticipant] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - request = build_call_connection_get_participant_request( + request = build_call_media_cancel_all_media_operations_request( call_connection_id=call_connection_id, - participant_raw_id=participant_raw_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1879,205 +1402,13 @@ async def get_participant( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) - deserialized = self._deserialize("CallParticipant", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - -class CallMediaOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.communication.callautomation.aio.AzureCommunicationCallAutomationService`'s - :attr:`call_media` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def play( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - play_request: _models.PlayRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Plays audio to participants in the call. - - Plays audio to participants in the call. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param play_request: play request payload. Required. - :type play_request: ~azure.communication.callautomation.models.PlayRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def play( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, play_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Plays audio to participants in the call. - - Plays audio to participants in the call. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param play_request: play request payload. Required. - :type play_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def play( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, play_request: Union[_models.PlayRequest, IO], **kwargs: Any - ) -> None: - """Plays audio to participants in the call. - - Plays audio to participants in the call. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param play_request: play request payload. Is either a PlayRequest type or a IO type. Required. - :type play_request: ~azure.communication.callautomation.models.PlayRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(play_request, (IOBase, bytes)): - _content = play_request - else: - _json = self._serialize.body(play_request, "PlayRequest") - - request = build_call_media_play_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - @distributed_trace_async - async def cancel_all_media_operations( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, **kwargs: Any - ) -> None: - """Cancel all media operations in a call. - - Cancel all media operations in a call. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_call_media_cancel_all_media_operations_request( - call_connection_id=call_connection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) @overload async def recognize( # pylint: disable=inconsistent-return-statements @@ -2195,374 +1526,6 @@ async def recognize( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - @overload - async def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: _models.ContinuousDtmfRecognitionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: Union[_models.ContinuousDtmfRecognitionRequest, IO], - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Is either a - ContinuousDtmfRecognitionRequest type or a IO type. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(continuous_dtmf_recognition_request, (IOBase, bytes)): - _content = continuous_dtmf_recognition_request - else: - _json = self._serialize.body(continuous_dtmf_recognition_request, "ContinuousDtmfRecognitionRequest") - - request = build_call_media_start_continuous_dtmf_recognition_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - async def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: _models.ContinuousDtmfRecognitionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: Union[_models.ContinuousDtmfRecognitionRequest, IO], - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Is either a - ContinuousDtmfRecognitionRequest type or a IO type. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(continuous_dtmf_recognition_request, (IOBase, bytes)): - _content = continuous_dtmf_recognition_request - else: - _json = self._serialize.body(continuous_dtmf_recognition_request, "ContinuousDtmfRecognitionRequest") - - request = build_call_media_stop_continuous_dtmf_recognition_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - async def send_dtmf( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - send_dtmf_request: _models.SendDtmfRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Required. - :type send_dtmf_request: ~azure.communication.callautomation.models.SendDtmfRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def send_dtmf( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, send_dtmf_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Required. - :type send_dtmf_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def send_dtmf( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, send_dtmf_request: Union[_models.SendDtmfRequest, IO], **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Is either a SendDtmfRequest type or a IO type. - Required. - :type send_dtmf_request: ~azure.communication.callautomation.models.SendDtmfRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(send_dtmf_request, (IOBase, bytes)): - _content = send_dtmf_request - else: - _json = self._serialize.body(send_dtmf_request, "SendDtmfRequest") - - request = build_call_media_send_dtmf_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - class CallRecordingOperations: """ @@ -2588,8 +1551,6 @@ async def start_recording( self, start_call_recording: _models.StartCallRecordingRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: @@ -2600,18 +1561,6 @@ async def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2622,13 +1571,7 @@ async def start_recording( @overload async def start_recording( - self, - start_call_recording: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, start_call_recording: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -2636,18 +1579,6 @@ async def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2658,12 +1589,7 @@ async def start_recording( @distributed_trace_async async def start_recording( - self, - start_call_recording: Union[_models.StartCallRecordingRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, start_call_recording: Union[_models.StartCallRecordingRequest, IO], **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -2673,18 +1599,6 @@ async def start_recording( StartCallRecordingRequest type or a IO type. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2715,8 +1629,8 @@ async def start_recording( _json = self._serialize.body(start_call_recording, "StartCallRecordingRequest") request = build_call_recording_start_recording_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/__init__.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/__init__.py index 91e4e2d733a3..18110f8cddcd 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/__init__.py @@ -11,7 +11,6 @@ from ._models import AddParticipantResponse from ._models import AddParticipantSucceeded from ._models import AnswerCallRequest -from ._models import BlobStorage from ._models import CallConnected from ._models import CallConnectionProperties from ._models import CallDisconnected @@ -20,28 +19,15 @@ from ._models import CallTransferAccepted from ._models import CallTransferFailed from ._models import ChannelAffinity -from ._models import Choice -from ._models import ChoiceResult -from ._models import CollectTonesResult from ._models import CommunicationError from ._models import CommunicationErrorResponse from ._models import CommunicationIdentifierModel from ._models import CommunicationUserIdentifierModel -from ._models import ContinuousDtmfRecognitionRequest -from ._models import ContinuousDtmfRecognitionStopped -from ._models import ContinuousDtmfRecognitionToneFailed -from ._models import ContinuousDtmfRecognitionToneReceived from ._models import CreateCallRequest -from ._models import CustomContext from ._models import DtmfOptions from ._models import DtmfResult -from ._models import ExternalStorage from ._models import FileSource -from ._models import GetParticipantsResponse -from ._models import MediaStreamingConfiguration from ._models import MicrosoftTeamsUserIdentifierModel -from ._models import MuteParticipantsRequest -from ._models import MuteParticipantsResponse from ._models import ParticipantsUpdated from ._models import PhoneNumberIdentifierModel from ._models import PlayCanceled @@ -64,19 +50,9 @@ from ._models import RemoveParticipantResponse from ._models import RemoveParticipantSucceeded from ._models import ResultInformation -from ._models import SendDtmfCompleted -from ._models import SendDtmfFailed -from ._models import SendDtmfRequest -from ._models import SpeechOptions -from ._models import SpeechResult -from ._models import SsmlSource from ._models import StartCallRecordingRequest -from ._models import TextSource -from ._models import ToneInfo from ._models import TransferCallResponse from ._models import TransferToParticipantRequest -from ._models import UnmuteParticipantsRequest -from ._models import UnmuteParticipantsResponse from ._enums import CallConnectionState from ._enums import CallLocatorKind @@ -84,10 +60,6 @@ from ._enums import CommunicationCloudEnvironmentModel from ._enums import CommunicationIdentifierModelKind from ._enums import DtmfTone -from ._enums import Gender -from ._enums import MediaStreamingAudioChannelType -from ._enums import MediaStreamingContentType -from ._enums import MediaStreamingTransportType from ._enums import PlaySourceType from ._enums import RecognitionType from ._enums import RecognizeInputType @@ -95,7 +67,6 @@ from ._enums import RecordingContent from ._enums import RecordingFormat from ._enums import RecordingState -from ._enums import RecordingStorage from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -106,7 +77,6 @@ "AddParticipantResponse", "AddParticipantSucceeded", "AnswerCallRequest", - "BlobStorage", "CallConnected", "CallConnectionProperties", "CallDisconnected", @@ -115,28 +85,15 @@ "CallTransferAccepted", "CallTransferFailed", "ChannelAffinity", - "Choice", - "ChoiceResult", - "CollectTonesResult", "CommunicationError", "CommunicationErrorResponse", "CommunicationIdentifierModel", "CommunicationUserIdentifierModel", - "ContinuousDtmfRecognitionRequest", - "ContinuousDtmfRecognitionStopped", - "ContinuousDtmfRecognitionToneFailed", - "ContinuousDtmfRecognitionToneReceived", "CreateCallRequest", - "CustomContext", "DtmfOptions", "DtmfResult", - "ExternalStorage", "FileSource", - "GetParticipantsResponse", - "MediaStreamingConfiguration", "MicrosoftTeamsUserIdentifierModel", - "MuteParticipantsRequest", - "MuteParticipantsResponse", "ParticipantsUpdated", "PhoneNumberIdentifierModel", "PlayCanceled", @@ -159,29 +116,15 @@ "RemoveParticipantResponse", "RemoveParticipantSucceeded", "ResultInformation", - "SendDtmfCompleted", - "SendDtmfFailed", - "SendDtmfRequest", - "SpeechOptions", - "SpeechResult", - "SsmlSource", "StartCallRecordingRequest", - "TextSource", - "ToneInfo", "TransferCallResponse", "TransferToParticipantRequest", - "UnmuteParticipantsRequest", - "UnmuteParticipantsResponse", "CallConnectionState", "CallLocatorKind", "CallRejectReason", "CommunicationCloudEnvironmentModel", "CommunicationIdentifierModelKind", "DtmfTone", - "Gender", - "MediaStreamingAudioChannelType", - "MediaStreamingContentType", - "MediaStreamingTransportType", "PlaySourceType", "RecognitionType", "RecognizeInputType", @@ -189,7 +132,6 @@ "RecordingContent", "RecordingFormat", "RecordingState", - "RecordingStorage", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_enums.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_enums.py index 26abdf7becf4..8b9a90394dfb 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_enums.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_enums.py @@ -38,7 +38,7 @@ class CallRejectReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CommunicationCloudEnvironmentModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CommunicationCloudEnvironmentModel.""" + """The cloud that the identifier belongs to.""" PUBLIC = "public" DOD = "dod" @@ -46,7 +46,7 @@ class CommunicationCloudEnvironmentModel(str, Enum, metaclass=CaseInsensitiveEnu class CommunicationIdentifierModelKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CommunicationIdentifierModel.""" + """The identifier kind, for example 'communicationUser' or 'phoneNumber'.""" UNKNOWN = "unknown" COMMUNICATION_USER = "communicationUser" @@ -75,38 +75,10 @@ class DtmfTone(str, Enum, metaclass=CaseInsensitiveEnumMeta): ASTERISK = "asterisk" -class Gender(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Voice gender type.""" - - MALE = "male" - FEMALE = "female" - - -class MediaStreamingAudioChannelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Audio channel type to stream, eg. unmixed audio, mixed audio.""" - - MIXED = "mixed" - UNMIXED = "unmixed" - - -class MediaStreamingContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Content type to stream, eg. audio, audio/video.""" - - AUDIO = "audio" - - -class MediaStreamingTransportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of transport to be used for media streaming, eg. Websocket.""" - - WEBSOCKET = "websocket" - - class PlaySourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the type of the play source.""" FILE = "file" - TEXT = "text" - SSML = "ssml" class RecognitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -115,18 +87,12 @@ class RecognitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ DTMF = "dtmf" - SPEECH = "speech" - SPEECH_OR_DTMF = "speechOrDtmf" - CHOICES = "choices" class RecognizeInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Determines the type of the recognition.""" DTMF = "dtmf" - SPEECH = "speech" - SPEECH_OR_DTMF = "speechOrDtmf" - CHOICES = "choices" class RecordingChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -156,10 +122,3 @@ class RecordingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE = "active" INACTIVE = "inactive" - - -class RecordingStorage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines the type of external storage.""" - - ACS = "acs" - BLOB_STORAGE = "blobStorage" diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py index 63044d991f04..da6374a579e9 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -17,7 +17,7 @@ class AddParticipantFailed(_serialization.Model): - """The failed to add participant event. + """The failed to add participants event. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -29,8 +29,7 @@ class AddParticipantFailed(_serialization.Model): :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation :ivar participant: Participant. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel @@ -67,8 +66,7 @@ def __init__( :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation :keyword participant: Participant. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel @@ -107,8 +105,6 @@ class AddParticipantRequest(_serialization.Model): :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar custom_context: Used by customer to send custom context to targets. - :vartype custom_context: ~azure.communication.callautomation.models.CustomContext """ _validation = { @@ -122,7 +118,6 @@ class AddParticipantRequest(_serialization.Model): "participant_to_add": {"key": "participantToAdd", "type": "CommunicationIdentifierModel"}, "invitation_timeout_in_seconds": {"key": "invitationTimeoutInSeconds", "type": "int"}, "operation_context": {"key": "operationContext", "type": "str"}, - "custom_context": {"key": "customContext", "type": "CustomContext"}, } def __init__( @@ -133,7 +128,6 @@ def __init__( source_display_name: Optional[str] = None, invitation_timeout_in_seconds: Optional[int] = None, operation_context: Optional[str] = None, - custom_context: Optional["_models.CustomContext"] = None, **kwargs: Any ) -> None: """ @@ -157,8 +151,6 @@ def __init__( :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword custom_context: Used by customer to send custom context to targets. - :paramtype custom_context: ~azure.communication.callautomation.models.CustomContext """ super().__init__(**kwargs) self.source_caller_id_number = source_caller_id_number @@ -166,7 +158,6 @@ def __init__( self.participant_to_add = participant_to_add self.invitation_timeout_in_seconds = invitation_timeout_in_seconds self.operation_context = operation_context - self.custom_context = custom_context class AddParticipantResponse(_serialization.Model): @@ -202,7 +193,7 @@ def __init__( class AddParticipantSucceeded(_serialization.Model): - """The participant successfully added event. + """The participants successfully added event. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -214,8 +205,7 @@ class AddParticipantSucceeded(_serialization.Model): :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation :ivar participant: Participant. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel @@ -252,8 +242,7 @@ def __init__( :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation :keyword participant: Participant. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel @@ -278,15 +267,8 @@ class AnswerCallRequest(_serialization.Model): :vartype callback_uri: str :ivar operation_context: A customer set value used to track the answering of a call. :vartype operation_context: str - :ivar media_streaming_configuration: Media Streaming Configuration. - :vartype media_streaming_configuration: - ~azure.communication.callautomation.models.MediaStreamingConfiguration - :ivar azure_cognitive_services_endpoint_url: The endpoint URL of the Azure Cognitive Services - resource attached. - :vartype azure_cognitive_services_endpoint_url: str - :ivar answered_by_identifier: The identifier of the call automation entity which answers the - call. - :vartype answered_by_identifier: + :ivar answered_by: The identifier of the call automation entity which answers the call. + :vartype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel """ @@ -299,9 +281,7 @@ class AnswerCallRequest(_serialization.Model): "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, "callback_uri": {"key": "callbackUri", "type": "str"}, "operation_context": {"key": "operationContext", "type": "str"}, - "media_streaming_configuration": {"key": "mediaStreamingConfiguration", "type": "MediaStreamingConfiguration"}, - "azure_cognitive_services_endpoint_url": {"key": "azureCognitiveServicesEndpointUrl", "type": "str"}, - "answered_by_identifier": {"key": "answeredByIdentifier", "type": "CommunicationUserIdentifierModel"}, + "answered_by": {"key": "answeredBy", "type": "CommunicationUserIdentifierModel"}, } def __init__( @@ -310,9 +290,7 @@ def __init__( incoming_call_context: str, callback_uri: str, operation_context: Optional[str] = None, - media_streaming_configuration: Optional["_models.MediaStreamingConfiguration"] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, - answered_by_identifier: Optional["_models.CommunicationUserIdentifierModel"] = None, + answered_by: Optional["_models.CommunicationUserIdentifierModel"] = None, **kwargs: Any ) -> None: """ @@ -322,50 +300,15 @@ def __init__( :paramtype callback_uri: str :keyword operation_context: A customer set value used to track the answering of a call. :paramtype operation_context: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: - ~azure.communication.callautomation.models.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: The endpoint URL of the Azure Cognitive - Services resource attached. - :paramtype azure_cognitive_services_endpoint_url: str - :keyword answered_by_identifier: The identifier of the call automation entity which answers the - call. - :paramtype answered_by_identifier: + :keyword answered_by: The identifier of the call automation entity which answers the call. + :paramtype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel """ super().__init__(**kwargs) self.incoming_call_context = incoming_call_context self.callback_uri = callback_uri self.operation_context = operation_context - self.media_streaming_configuration = media_streaming_configuration - self.azure_cognitive_services_endpoint_url = azure_cognitive_services_endpoint_url - self.answered_by_identifier = answered_by_identifier - - -class BlobStorage(_serialization.Model): - """Used to specify Blob container url to recording storage. - - All required parameters must be populated in order to send to Azure. - - :ivar container_uri: Url of a container or a location within a container. Required. - :vartype container_uri: str - """ - - _validation = { - "container_uri": {"required": True}, - } - - _attribute_map = { - "container_uri": {"key": "containerUri", "type": "str"}, - } - - def __init__(self, *, container_uri: str, **kwargs: Any) -> None: - """ - :keyword container_uri: Url of a container or a location within a container. Required. - :paramtype container_uri: str - """ - super().__init__(**kwargs) - self.container_uri = container_uri + self.answered_by = answered_by class CallConnected(_serialization.Model): @@ -418,7 +361,7 @@ def __init__( self.operation_context = operation_context -class CallConnectionProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class CallConnectionProperties(_serialization.Model): """Properties of a call connection. :ivar call_connection_id: The call connection id. @@ -434,8 +377,6 @@ class CallConnectionProperties(_serialization.Model): # pylint: disable=too-man ~azure.communication.callautomation.models.CallConnectionState :ivar callback_uri: The callback URI. :vartype callback_uri: str - :ivar media_subscription_id: SubscriptionId for media streaming. - :vartype media_subscription_id: str :ivar source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN participant being invited. Required only when calling a PSTN callee. @@ -443,14 +384,13 @@ class CallConnectionProperties(_serialization.Model): # pylint: disable=too-man ~azure.communication.callautomation.models.PhoneNumberIdentifierModel :ivar source_display_name: Display name of the call if dialing out to a pstn number. :vartype source_display_name: str - :ivar source_identity: Source identity. - :vartype source_identity: - ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar source: Source identity. + :vartype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar correlation_id: The correlation ID. :vartype correlation_id: str - :ivar answered_by_identifier: Identity of the answering entity. Only populated when identity is - provided in the request. - :vartype answered_by_identifier: + :ivar answered_by: Identity of the answering entity. Only populated when identity is provided + in the request. + :vartype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel """ @@ -460,12 +400,11 @@ class CallConnectionProperties(_serialization.Model): # pylint: disable=too-man "targets": {"key": "targets", "type": "[CommunicationIdentifierModel]"}, "call_connection_state": {"key": "callConnectionState", "type": "str"}, "callback_uri": {"key": "callbackUri", "type": "str"}, - "media_subscription_id": {"key": "mediaSubscriptionId", "type": "str"}, "source_caller_id_number": {"key": "sourceCallerIdNumber", "type": "PhoneNumberIdentifierModel"}, "source_display_name": {"key": "sourceDisplayName", "type": "str"}, - "source_identity": {"key": "sourceIdentity", "type": "CommunicationIdentifierModel"}, + "source": {"key": "source", "type": "CommunicationIdentifierModel"}, "correlation_id": {"key": "correlationId", "type": "str"}, - "answered_by_identifier": {"key": "answeredByIdentifier", "type": "CommunicationUserIdentifierModel"}, + "answered_by": {"key": "answeredBy", "type": "CommunicationUserIdentifierModel"}, } def __init__( @@ -476,12 +415,11 @@ def __init__( targets: Optional[List["_models.CommunicationIdentifierModel"]] = None, call_connection_state: Optional[Union[str, "_models.CallConnectionState"]] = None, callback_uri: Optional[str] = None, - media_subscription_id: Optional[str] = None, source_caller_id_number: Optional["_models.PhoneNumberIdentifierModel"] = None, source_display_name: Optional[str] = None, - source_identity: Optional["_models.CommunicationIdentifierModel"] = None, + source: Optional["_models.CommunicationIdentifierModel"] = None, correlation_id: Optional[str] = None, - answered_by_identifier: Optional["_models.CommunicationUserIdentifierModel"] = None, + answered_by: Optional["_models.CommunicationUserIdentifierModel"] = None, **kwargs: Any ) -> None: """ @@ -499,8 +437,6 @@ def __init__( ~azure.communication.callautomation.models.CallConnectionState :keyword callback_uri: The callback URI. :paramtype callback_uri: str - :keyword media_subscription_id: SubscriptionId for media streaming. - :paramtype media_subscription_id: str :keyword source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN participant being invited. Required only when calling a PSTN callee. @@ -508,14 +444,13 @@ def __init__( ~azure.communication.callautomation.models.PhoneNumberIdentifierModel :keyword source_display_name: Display name of the call if dialing out to a pstn number. :paramtype source_display_name: str - :keyword source_identity: Source identity. - :paramtype source_identity: - ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword source: Source identity. + :paramtype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword correlation_id: The correlation ID. :paramtype correlation_id: str - :keyword answered_by_identifier: Identity of the answering entity. Only populated when identity - is provided in the request. - :paramtype answered_by_identifier: + :keyword answered_by: Identity of the answering entity. Only populated when identity is + provided in the request. + :paramtype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel """ super().__init__(**kwargs) @@ -524,12 +459,11 @@ def __init__( self.targets = targets self.call_connection_state = call_connection_state self.callback_uri = callback_uri - self.media_subscription_id = media_subscription_id self.source_caller_id_number = source_caller_id_number self.source_display_name = source_display_name - self.source_identity = source_identity + self.source = source self.correlation_id = correlation_id - self.answered_by_identifier = answered_by_identifier + self.answered_by = answered_by class CallDisconnected(_serialization.Model): @@ -624,7 +558,7 @@ def __init__( class CallParticipant(_serialization.Model): - """Contract model of an ACS call participant. + """A call participant. :ivar identifier: Communication identifier of the participant. :vartype identifier: ~azure.communication.callautomation.models.CommunicationIdentifierModel @@ -668,8 +602,7 @@ class CallTransferAccepted(_serialization.Model): :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -702,8 +635,7 @@ def __init__( :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -727,8 +659,7 @@ class CallTransferFailed(_serialization.Model): :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -761,8 +692,7 @@ def __init__( :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -813,163 +743,62 @@ def __init__( self.participant = participant -class Choice(_serialization.Model): - """Choice. - - All required parameters must be populated in order to send to Azure. - - :ivar label: Identifier for a given choice. Required. - :vartype label: str - :ivar phrases: List of phrases to recognize. Required. - :vartype phrases: list[str] - :ivar tone: Known values are: "zero", "one", "two", "three", "four", "five", "six", "seven", - "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". - :vartype tone: str or ~azure.communication.callautomation.models.DtmfTone - """ - - _validation = { - "label": {"required": True}, - "phrases": {"required": True}, - } - - _attribute_map = { - "label": {"key": "label", "type": "str"}, - "phrases": {"key": "phrases", "type": "[str]"}, - "tone": {"key": "tone", "type": "str"}, - } - - def __init__( - self, *, label: str, phrases: List[str], tone: Optional[Union[str, "_models.DtmfTone"]] = None, **kwargs: Any - ) -> None: - """ - :keyword label: Identifier for a given choice. Required. - :paramtype label: str - :keyword phrases: List of phrases to recognize. Required. - :paramtype phrases: list[str] - :keyword tone: Known values are: "zero", "one", "two", "three", "four", "five", "six", "seven", - "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". - :paramtype tone: str or ~azure.communication.callautomation.models.DtmfTone - """ - super().__init__(**kwargs) - self.label = label - self.phrases = phrases - self.tone = tone - - -class ChoiceResult(_serialization.Model): - """ChoiceResult. - - :ivar label: Label is the primary identifier for the choice detected. - :vartype label: str - :ivar recognized_phrase: Phrases are set to the value if choice is selected via phrase - detection. - If Dtmf input is recognized, then Label will be the identifier for the choice detected and - phrases will be set to null. - :vartype recognized_phrase: str - """ - - _attribute_map = { - "label": {"key": "label", "type": "str"}, - "recognized_phrase": {"key": "recognizedPhrase", "type": "str"}, - } - - def __init__(self, *, label: Optional[str] = None, recognized_phrase: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword label: Label is the primary identifier for the choice detected. - :paramtype label: str - :keyword recognized_phrase: Phrases are set to the value if choice is selected via phrase - detection. - If Dtmf input is recognized, then Label will be the identifier for the choice detected and - phrases will be set to null. - :paramtype recognized_phrase: str - """ - super().__init__(**kwargs) - self.label = label - self.recognized_phrase = recognized_phrase - - -class CollectTonesResult(_serialization.Model): - """CollectTonesResult. +class CommunicationError(_serialization.Model): + """The Communication Services error. Variables are only populated by the server, and will be ignored when sending a request. - :ivar tones: - :vartype tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - """ - - _validation = { - "tones": {"readonly": True}, - } - - _attribute_map = { - "tones": {"key": "tones", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.tones = None - - -class CommunicationError(_serialization.Model): - """CommunicationError. + All required parameters must be populated in order to send to Azure. - :ivar code: + :ivar code: The error code. Required. :vartype code: str - :ivar message: + :ivar message: The error message. Required. :vartype message: str - :ivar target: + :ivar target: The error target. :vartype target: str - :ivar details: + :ivar details: Further details about specific errors that led to this error. :vartype details: list[~azure.communication.callautomation.models.CommunicationError] - :ivar innererror: - :vartype innererror: ~azure.communication.callautomation.models.CommunicationError + :ivar inner_error: The inner error if any. + :vartype inner_error: ~azure.communication.callautomation.models.CommunicationError """ + _validation = { + "code": {"required": True}, + "message": {"required": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "inner_error": {"readonly": True}, + } + _attribute_map = { "code": {"key": "code", "type": "str"}, "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[CommunicationError]"}, - "innererror": {"key": "innererror", "type": "CommunicationError"}, + "inner_error": {"key": "innererror", "type": "CommunicationError"}, } - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[List["_models.CommunicationError"]] = None, - innererror: Optional["_models.CommunicationError"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, code: str, message: str, **kwargs: Any) -> None: """ - :keyword code: + :keyword code: The error code. Required. :paramtype code: str - :keyword message: + :keyword message: The error message. Required. :paramtype message: str - :keyword target: - :paramtype target: str - :keyword details: - :paramtype details: list[~azure.communication.callautomation.models.CommunicationError] - :keyword innererror: - :paramtype innererror: ~azure.communication.callautomation.models.CommunicationError """ super().__init__(**kwargs) self.code = code self.message = message - self.target = target - self.details = details - self.innererror = innererror + self.target = None + self.details = None + self.inner_error = None class CommunicationErrorResponse(_serialization.Model): - """The Communication Services error response. + """The Communication Services error. All required parameters must be populated in order to send to Azure. - :ivar error: Required. + :ivar error: The Communication Services error. Required. :vartype error: ~azure.communication.callautomation.models.CommunicationError """ @@ -983,7 +812,7 @@ class CommunicationErrorResponse(_serialization.Model): def __init__(self, *, error: "_models.CommunicationError", **kwargs: Any) -> None: """ - :keyword error: Required. + :keyword error: The Communication Services error. Required. :paramtype error: ~azure.communication.callautomation.models.CommunicationError """ super().__init__(**kwargs) @@ -991,14 +820,16 @@ def __init__(self, *, error: "_models.CommunicationError", **kwargs: Any) -> Non class CommunicationIdentifierModel(_serialization.Model): - """CommunicationIdentifierModel. + """Identifies a participant in Azure Communication services. A participant is, for example, a + phone number or an Azure communication user. This model is polymorphic: Apart from kind and + rawId, at most one further property may be set which must match the kind enum value. - :ivar raw_id: Full ID of the identifier. - :vartype raw_id: str - :ivar kind: Type of CommunicationIdentifierModel. Known values are: "unknown", + :ivar kind: The identifier kind. Only required in responses. Known values are: "unknown", "communicationUser", "phoneNumber", and "microsoftTeamsUser". :vartype kind: str or ~azure.communication.callautomation.models.CommunicationIdentifierModelKind + :ivar raw_id: Raw Id of the identifier. Optional in requests, required in responses. + :vartype raw_id: str :ivar communication_user: The communication user. :vartype communication_user: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel @@ -1010,8 +841,8 @@ class CommunicationIdentifierModel(_serialization.Model): """ _attribute_map = { - "raw_id": {"key": "rawId", "type": "str"}, "kind": {"key": "kind", "type": "str"}, + "raw_id": {"key": "rawId", "type": "str"}, "communication_user": {"key": "communicationUser", "type": "CommunicationUserIdentifierModel"}, "phone_number": {"key": "phoneNumber", "type": "PhoneNumberIdentifierModel"}, "microsoft_teams_user": {"key": "microsoftTeamsUser", "type": "MicrosoftTeamsUserIdentifierModel"}, @@ -1020,20 +851,20 @@ class CommunicationIdentifierModel(_serialization.Model): def __init__( self, *, - raw_id: Optional[str] = None, kind: Optional[Union[str, "_models.CommunicationIdentifierModelKind"]] = None, + raw_id: Optional[str] = None, communication_user: Optional["_models.CommunicationUserIdentifierModel"] = None, phone_number: Optional["_models.PhoneNumberIdentifierModel"] = None, microsoft_teams_user: Optional["_models.MicrosoftTeamsUserIdentifierModel"] = None, **kwargs: Any ) -> None: """ - :keyword raw_id: Full ID of the identifier. - :paramtype raw_id: str - :keyword kind: Type of CommunicationIdentifierModel. Known values are: "unknown", + :keyword kind: The identifier kind. Only required in responses. Known values are: "unknown", "communicationUser", "phoneNumber", and "microsoftTeamsUser". :paramtype kind: str or ~azure.communication.callautomation.models.CommunicationIdentifierModelKind + :keyword raw_id: Raw Id of the identifier. Optional in requests, required in responses. + :paramtype raw_id: str :keyword communication_user: The communication user. :paramtype communication_user: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel @@ -1044,19 +875,19 @@ def __init__( ~azure.communication.callautomation.models.MicrosoftTeamsUserIdentifierModel """ super().__init__(**kwargs) - self.raw_id = raw_id self.kind = kind + self.raw_id = raw_id self.communication_user = communication_user self.phone_number = phone_number self.microsoft_teams_user = microsoft_teams_user class CommunicationUserIdentifierModel(_serialization.Model): - """CommunicationUserIdentifierModel. + """A user that got created with an Azure Communication Services resource. All required parameters must be populated in order to send to Azure. - :ivar id: Required. + :ivar id: The Id of the communication user. Required. :vartype id: str """ @@ -1070,418 +901,145 @@ class CommunicationUserIdentifierModel(_serialization.Model): def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ - :keyword id: Required. + :keyword id: The Id of the communication user. Required. :paramtype id: str """ super().__init__(**kwargs) self.id = id -class ContinuousDtmfRecognitionRequest(_serialization.Model): - """ContinuousDtmfRecognitionRequest. +class CreateCallRequest(_serialization.Model): + """The request payload for creating the call. All required parameters must be populated in order to send to Azure. - :ivar target_participant: Defines options for recognition. Required. - :vartype target_participant: - ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar operation_context: The value to identify context of the operation. + :ivar targets: The targets of the call. Required. + :vartype targets: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] + :ivar source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN + participant being invited. + Required only when calling a PSTN callee. + :vartype source_caller_id_number: + ~azure.communication.callautomation.models.PhoneNumberIdentifierModel + :ivar source_display_name: Display name of the call if dialing out to a pstn number. + :vartype source_display_name: str + :ivar source: The identifier of the source of the call. + :vartype source: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel + :ivar operation_context: A customer set value used to track the answering of a call. :vartype operation_context: str + :ivar callback_uri: The callback URI. Required. + :vartype callback_uri: str """ _validation = { - "target_participant": {"required": True}, + "targets": {"required": True}, + "callback_uri": {"required": True}, } _attribute_map = { - "target_participant": {"key": "targetParticipant", "type": "CommunicationIdentifierModel"}, + "targets": {"key": "targets", "type": "[CommunicationIdentifierModel]"}, + "source_caller_id_number": {"key": "sourceCallerIdNumber", "type": "PhoneNumberIdentifierModel"}, + "source_display_name": {"key": "sourceDisplayName", "type": "str"}, + "source": {"key": "source", "type": "CommunicationUserIdentifierModel"}, "operation_context": {"key": "operationContext", "type": "str"}, + "callback_uri": {"key": "callbackUri", "type": "str"}, } def __init__( self, *, - target_participant: "_models.CommunicationIdentifierModel", + targets: List["_models.CommunicationIdentifierModel"], + callback_uri: str, + source_caller_id_number: Optional["_models.PhoneNumberIdentifierModel"] = None, + source_display_name: Optional[str] = None, + source: Optional["_models.CommunicationUserIdentifierModel"] = None, operation_context: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword target_participant: Defines options for recognition. Required. - :paramtype target_participant: - ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword operation_context: The value to identify context of the operation. + :keyword targets: The targets of the call. Required. + :paramtype targets: + list[~azure.communication.callautomation.models.CommunicationIdentifierModel] + :keyword source_caller_id_number: The source caller Id, a phone number, that's shown to the + PSTN participant being invited. + Required only when calling a PSTN callee. + :paramtype source_caller_id_number: + ~azure.communication.callautomation.models.PhoneNumberIdentifierModel + :keyword source_display_name: Display name of the call if dialing out to a pstn number. + :paramtype source_display_name: str + :keyword source: The identifier of the source of the call. + :paramtype source: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel + :keyword operation_context: A customer set value used to track the answering of a call. :paramtype operation_context: str + :keyword callback_uri: The callback URI. Required. + :paramtype callback_uri: str """ super().__init__(**kwargs) - self.target_participant = target_participant + self.targets = targets + self.source_caller_id_number = source_caller_id_number + self.source_display_name = source_display_name + self.source = source self.operation_context = operation_context + self.callback_uri = callback_uri -class ContinuousDtmfRecognitionStopped(_serialization.Model): - """ContinuousDtmfRecognitionStopped. +class DtmfOptions(_serialization.Model): + """Options for DTMF recognition. - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar inter_tone_timeout_in_seconds: Time to wait between DTMF inputs to stop recognizing. + :vartype inter_tone_timeout_in_seconds: int + :ivar max_tones_to_collect: Maximum number of DTMF tones to be collected. + :vartype max_tones_to_collect: int + :ivar stop_tones: List of tones that will stop recognizing. + :vartype stop_tones: list[str or ~azure.communication.callautomation.models.DtmfTone] """ + _validation = { + "inter_tone_timeout_in_seconds": {"maximum": 60, "minimum": 1}, + } + _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "inter_tone_timeout_in_seconds": {"key": "interToneTimeoutInSeconds", "type": "int"}, + "max_tones_to_collect": {"key": "maxTonesToCollect", "type": "int"}, + "stop_tones": {"key": "stopTones", "type": "[str]"}, } def __init__( self, *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, + inter_tone_timeout_in_seconds: Optional[int] = None, + max_tones_to_collect: Optional[int] = None, + stop_tones: Optional[List[Union[str, "_models.DtmfTone"]]] = None, **kwargs: Any ) -> None: """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword inter_tone_timeout_in_seconds: Time to wait between DTMF inputs to stop recognizing. + :paramtype inter_tone_timeout_in_seconds: int + :keyword max_tones_to_collect: Maximum number of DTMF tones to be collected. + :paramtype max_tones_to_collect: int + :keyword stop_tones: List of tones that will stop recognizing. + :paramtype stop_tones: list[str or ~azure.communication.callautomation.models.DtmfTone] """ super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.operation_context = operation_context - self.result_information = result_information + self.inter_tone_timeout_in_seconds = inter_tone_timeout_in_seconds + self.max_tones_to_collect = max_tones_to_collect + self.stop_tones = stop_tones -class ContinuousDtmfRecognitionToneFailed(_serialization.Model): - """ContinuousDtmfRecognitionToneFailed. +class DtmfResult(_serialization.Model): + """DtmfResult. - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tones: + :vartype tones: list[str or ~azure.communication.callautomation.models.DtmfTone] """ + _validation = { + "tones": {"readonly": True}, + } + _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__( - self, - *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, - operation_context: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.result_information = result_information - self.operation_context = operation_context - - -class ContinuousDtmfRecognitionToneReceived(_serialization.Model): - """ContinuousDtmfRecognitionToneReceived. - - :ivar tone_info: Information about Tone. - :vartype tone_info: ~azure.communication.callautomation.models.ToneInfo - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId or - skype chain ID. - :vartype correlation_id: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - """ - - _attribute_map = { - "tone_info": {"key": "toneInfo", "type": "ToneInfo"}, - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__( - self, - *, - tone_info: Optional["_models.ToneInfo"] = None, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, - operation_context: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tone_info: Information about Tone. - :paramtype tone_info: ~azure.communication.callautomation.models.ToneInfo - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId or - skype chain ID. - :paramtype correlation_id: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.tone_info = tone_info - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.result_information = result_information - self.operation_context = operation_context - - -class CreateCallRequest(_serialization.Model): - """The request payload for creating the call. - - All required parameters must be populated in order to send to Azure. - - :ivar targets: The targets of the call. Required. - :vartype targets: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN - participant being invited. - Required only when calling a PSTN callee. - :vartype source_caller_id_number: - ~azure.communication.callautomation.models.PhoneNumberIdentifierModel - :ivar source_display_name: Display name of the call if dialing out to a pstn number. - :vartype source_display_name: str - :ivar source_identity: The identifier of the source of the call. - :vartype source_identity: - ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :ivar operation_context: A customer set value used to track the answering of a call. - :vartype operation_context: str - :ivar callback_uri: The callback URI. Required. - :vartype callback_uri: str - :ivar media_streaming_configuration: Media Streaming Configuration. - :vartype media_streaming_configuration: - ~azure.communication.callautomation.models.MediaStreamingConfiguration - :ivar azure_cognitive_services_endpoint_url: The identifier of the Cognitive Service resource - assigned to this call. - :vartype azure_cognitive_services_endpoint_url: str - :ivar custom_context: Used by customer to send custom context to targets. - :vartype custom_context: ~azure.communication.callautomation.models.CustomContext - """ - - _validation = { - "targets": {"required": True}, - "callback_uri": {"required": True}, - } - - _attribute_map = { - "targets": {"key": "targets", "type": "[CommunicationIdentifierModel]"}, - "source_caller_id_number": {"key": "sourceCallerIdNumber", "type": "PhoneNumberIdentifierModel"}, - "source_display_name": {"key": "sourceDisplayName", "type": "str"}, - "source_identity": {"key": "sourceIdentity", "type": "CommunicationUserIdentifierModel"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "callback_uri": {"key": "callbackUri", "type": "str"}, - "media_streaming_configuration": {"key": "mediaStreamingConfiguration", "type": "MediaStreamingConfiguration"}, - "azure_cognitive_services_endpoint_url": {"key": "azureCognitiveServicesEndpointUrl", "type": "str"}, - "custom_context": {"key": "customContext", "type": "CustomContext"}, - } - - def __init__( - self, - *, - targets: List["_models.CommunicationIdentifierModel"], - callback_uri: str, - source_caller_id_number: Optional["_models.PhoneNumberIdentifierModel"] = None, - source_display_name: Optional[str] = None, - source_identity: Optional["_models.CommunicationUserIdentifierModel"] = None, - operation_context: Optional[str] = None, - media_streaming_configuration: Optional["_models.MediaStreamingConfiguration"] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, - custom_context: Optional["_models.CustomContext"] = None, - **kwargs: Any - ) -> None: - """ - :keyword targets: The targets of the call. Required. - :paramtype targets: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :keyword source_caller_id_number: The source caller Id, a phone number, that's shown to the - PSTN participant being invited. - Required only when calling a PSTN callee. - :paramtype source_caller_id_number: - ~azure.communication.callautomation.models.PhoneNumberIdentifierModel - :keyword source_display_name: Display name of the call if dialing out to a pstn number. - :paramtype source_display_name: str - :keyword source_identity: The identifier of the source of the call. - :paramtype source_identity: - ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :keyword operation_context: A customer set value used to track the answering of a call. - :paramtype operation_context: str - :keyword callback_uri: The callback URI. Required. - :paramtype callback_uri: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: - ~azure.communication.callautomation.models.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: The identifier of the Cognitive Service - resource assigned to this call. - :paramtype azure_cognitive_services_endpoint_url: str - :keyword custom_context: Used by customer to send custom context to targets. - :paramtype custom_context: ~azure.communication.callautomation.models.CustomContext - """ - super().__init__(**kwargs) - self.targets = targets - self.source_caller_id_number = source_caller_id_number - self.source_display_name = source_display_name - self.source_identity = source_identity - self.operation_context = operation_context - self.callback_uri = callback_uri - self.media_streaming_configuration = media_streaming_configuration - self.azure_cognitive_services_endpoint_url = azure_cognitive_services_endpoint_url - self.custom_context = custom_context - - -class CustomContext(_serialization.Model): - """CustomContext. - - :ivar voip_headers: Dictionary of :code:``. - :vartype voip_headers: dict[str, str] - :ivar sip_headers: Dictionary of :code:``. - :vartype sip_headers: dict[str, str] - """ - - _attribute_map = { - "voip_headers": {"key": "voipHeaders", "type": "{str}"}, - "sip_headers": {"key": "sipHeaders", "type": "{str}"}, - } - - def __init__( - self, - *, - voip_headers: Optional[Dict[str, str]] = None, - sip_headers: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword voip_headers: Dictionary of :code:``. - :paramtype voip_headers: dict[str, str] - :keyword sip_headers: Dictionary of :code:``. - :paramtype sip_headers: dict[str, str] - """ - super().__init__(**kwargs) - self.voip_headers = voip_headers - self.sip_headers = sip_headers - - -class DtmfOptions(_serialization.Model): - """Options for DTMF recognition. - - :ivar inter_tone_timeout_in_seconds: Time to wait between DTMF inputs to stop recognizing. - :vartype inter_tone_timeout_in_seconds: int - :ivar max_tones_to_collect: Maximum number of DTMF tones to be collected. - :vartype max_tones_to_collect: int - :ivar stop_tones: List of tones that will stop recognizing. - :vartype stop_tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - """ - - _validation = { - "inter_tone_timeout_in_seconds": {"maximum": 60, "minimum": 1}, - } - - _attribute_map = { - "inter_tone_timeout_in_seconds": {"key": "interToneTimeoutInSeconds", "type": "int"}, - "max_tones_to_collect": {"key": "maxTonesToCollect", "type": "int"}, - "stop_tones": {"key": "stopTones", "type": "[str]"}, - } - - def __init__( - self, - *, - inter_tone_timeout_in_seconds: Optional[int] = None, - max_tones_to_collect: Optional[int] = None, - stop_tones: Optional[List[Union[str, "_models.DtmfTone"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword inter_tone_timeout_in_seconds: Time to wait between DTMF inputs to stop recognizing. - :paramtype inter_tone_timeout_in_seconds: int - :keyword max_tones_to_collect: Maximum number of DTMF tones to be collected. - :paramtype max_tones_to_collect: int - :keyword stop_tones: List of tones that will stop recognizing. - :paramtype stop_tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - """ - super().__init__(**kwargs) - self.inter_tone_timeout_in_seconds = inter_tone_timeout_in_seconds - self.max_tones_to_collect = max_tones_to_collect - self.stop_tones = stop_tones - - -class DtmfResult(_serialization.Model): - """DtmfResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tones: - :vartype tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - """ - - _validation = { - "tones": {"readonly": True}, - } - - _attribute_map = { - "tones": {"key": "tones", "type": "[str]"}, + "tones": {"key": "tones", "type": "[str]"}, } def __init__(self, **kwargs: Any) -> None: @@ -1490,46 +1048,6 @@ def __init__(self, **kwargs: Any) -> None: self.tones = None -class ExternalStorage(_serialization.Model): - """ExternalStorage. - - All required parameters must be populated in order to send to Azure. - - :ivar storage_type: Defines the type of external storage. Required. Known values are: "acs" and - "blobStorage". - :vartype storage_type: str or ~azure.communication.callautomation.models.RecordingStorage - :ivar blob_storage: Defines the blob storage location where the recording will be stored. - :vartype blob_storage: ~azure.communication.callautomation.models.BlobStorage - """ - - _validation = { - "storage_type": {"required": True}, - } - - _attribute_map = { - "storage_type": {"key": "storageType", "type": "str"}, - "blob_storage": {"key": "blobStorage", "type": "BlobStorage"}, - } - - def __init__( - self, - *, - storage_type: Union[str, "_models.RecordingStorage"], - blob_storage: Optional["_models.BlobStorage"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_type: Defines the type of external storage. Required. Known values are: "acs" - and "blobStorage". - :paramtype storage_type: str or ~azure.communication.callautomation.models.RecordingStorage - :keyword blob_storage: Defines the blob storage location where the recording will be stored. - :paramtype blob_storage: ~azure.communication.callautomation.models.BlobStorage - """ - super().__init__(**kwargs) - self.storage_type = storage_type - self.blob_storage = blob_storage - - class FileSource(_serialization.Model): """FileSource. @@ -1559,596 +1077,172 @@ def __init__(self, *, uri: str, **kwargs: Any) -> None: class GetParticipantsResponse(_serialization.Model): """The response payload for getting participants of the call. - :ivar values: List of the current participants in the call. - :vartype values: list[~azure.communication.callautomation.models.CallParticipant] + All required parameters must be populated in order to send to Azure. + + :ivar value: List of the current participants in the call. Required. + :vartype value: list[~azure.communication.callautomation.models.CallParticipant] :ivar next_link: Continue of the list of participants. :vartype next_link: str """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "values": {"key": "values", "type": "[CallParticipant]"}, + "value": {"key": "value", "type": "[CallParticipant]"}, "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - values: Optional[List["_models.CallParticipant"]] = None, - next_link: Optional[str] = None, - **kwargs: Any + self, *, value: List["_models.CallParticipant"], next_link: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword values: List of the current participants in the call. - :paramtype values: list[~azure.communication.callautomation.models.CallParticipant] + :keyword value: List of the current participants in the call. Required. + :paramtype value: list[~azure.communication.callautomation.models.CallParticipant] :keyword next_link: Continue of the list of participants. :paramtype next_link: str """ super().__init__(**kwargs) - self.values = values + self.value = value self.next_link = next_link -class MediaStreamingConfiguration(_serialization.Model): - """Configuration of Media streaming. +class MicrosoftTeamsUserIdentifierModel(_serialization.Model): + """A Microsoft Teams user. All required parameters must be populated in order to send to Azure. - :ivar transport_url: Transport URL for media streaming. Required. - :vartype transport_url: str - :ivar transport_type: The type of transport to be used for media streaming, eg. Websocket. - Required. "websocket" - :vartype transport_type: str or - ~azure.communication.callautomation.models.MediaStreamingTransportType - :ivar content_type: Content type to stream, eg. audio, audio/video. Required. "audio" - :vartype content_type: str or - ~azure.communication.callautomation.models.MediaStreamingContentType - :ivar audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio. - Required. Known values are: "mixed" and "unmixed". - :vartype audio_channel_type: str or - ~azure.communication.callautomation.models.MediaStreamingAudioChannelType + :ivar user_id: The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id + of the user. Required. + :vartype user_id: str + :ivar is_anonymous: True if the Microsoft Teams user is anonymous. By default false if missing. + :vartype is_anonymous: bool + :ivar cloud: The cloud that the Microsoft Teams user belongs to. By default 'public' if + missing. Known values are: "public", "dod", and "gcch". + :vartype cloud: str or + ~azure.communication.callautomation.models.CommunicationCloudEnvironmentModel """ _validation = { - "transport_url": {"required": True}, - "transport_type": {"required": True}, - "content_type": {"required": True}, - "audio_channel_type": {"required": True}, - } - - _attribute_map = { - "transport_url": {"key": "transportUrl", "type": "str"}, - "transport_type": {"key": "transportType", "type": "str"}, - "content_type": {"key": "contentType", "type": "str"}, - "audio_channel_type": {"key": "audioChannelType", "type": "str"}, - } - - def __init__( - self, - *, - transport_url: str, - transport_type: Union[str, "_models.MediaStreamingTransportType"], - content_type: Union[str, "_models.MediaStreamingContentType"], - audio_channel_type: Union[str, "_models.MediaStreamingAudioChannelType"], - **kwargs: Any - ) -> None: - """ - :keyword transport_url: Transport URL for media streaming. Required. - :paramtype transport_url: str - :keyword transport_type: The type of transport to be used for media streaming, eg. Websocket. - Required. "websocket" - :paramtype transport_type: str or - ~azure.communication.callautomation.models.MediaStreamingTransportType - :keyword content_type: Content type to stream, eg. audio, audio/video. Required. "audio" - :paramtype content_type: str or - ~azure.communication.callautomation.models.MediaStreamingContentType - :keyword audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio. - Required. Known values are: "mixed" and "unmixed". - :paramtype audio_channel_type: str or - ~azure.communication.callautomation.models.MediaStreamingAudioChannelType - """ - super().__init__(**kwargs) - self.transport_url = transport_url - self.transport_type = transport_type - self.content_type = content_type - self.audio_channel_type = audio_channel_type - - -class MicrosoftTeamsUserIdentifierModel(_serialization.Model): - """MicrosoftTeamsUserIdentifierModel. - - All required parameters must be populated in order to send to Azure. - - :ivar user_id: Required. - :vartype user_id: str - :ivar is_anonymous: - :vartype is_anonymous: bool - :ivar cloud: Known values are: "public", "dod", and "gcch". - :vartype cloud: str or - ~azure.communication.callautomation.models.CommunicationCloudEnvironmentModel - """ - - _validation = { - "user_id": {"required": True}, + "user_id": {"required": True}, } _attribute_map = { "user_id": {"key": "userId", "type": "str"}, "is_anonymous": {"key": "isAnonymous", "type": "bool"}, - "cloud": {"key": "cloud", "type": "str"}, - } - - def __init__( - self, - *, - user_id: str, - is_anonymous: Optional[bool] = None, - cloud: Optional[Union[str, "_models.CommunicationCloudEnvironmentModel"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword user_id: Required. - :paramtype user_id: str - :keyword is_anonymous: - :paramtype is_anonymous: bool - :keyword cloud: Known values are: "public", "dod", and "gcch". - :paramtype cloud: str or - ~azure.communication.callautomation.models.CommunicationCloudEnvironmentModel - """ - super().__init__(**kwargs) - self.user_id = user_id - self.is_anonymous = is_anonymous - self.cloud = cloud - - -class MuteParticipantsRequest(_serialization.Model): - """The request payload for muting participants from the call. - - All required parameters must be populated in order to send to Azure. - - :ivar target_participants: Participants to be muted from the call. - Only ACS Users are supported. Required. - :vartype target_participants: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - """ - - _validation = { - "target_participants": {"required": True}, - } - - _attribute_map = { - "target_participants": {"key": "targetParticipants", "type": "[CommunicationIdentifierModel]"}, - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__( - self, - *, - target_participants: List["_models.CommunicationIdentifierModel"], - operation_context: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword target_participants: Participants to be muted from the call. - Only ACS Users are supported. Required. - :paramtype target_participants: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.target_participants = target_participants - self.operation_context = operation_context - - -class MuteParticipantsResponse(_serialization.Model): - """The response payload for muting participants from the call. - - :ivar operation_context: The operation context provided by client. - :vartype operation_context: str - """ - - _attribute_map = { - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__(self, *, operation_context: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword operation_context: The operation context provided by client. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.operation_context = operation_context - - -class ParticipantsUpdated(_serialization.Model): - """The participants updated in a call event. - - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. - :vartype correlation_id: str - :ivar sequence_number: The Sequence Number of the event. - :vartype sequence_number: int - :ivar participants: The list of participants in the call. - :vartype participants: list[~azure.communication.callautomation.models.CallParticipant] - """ - - _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "participants": {"key": "participants", "type": "[CallParticipant]"}, - } - - def __init__( - self, - *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - sequence_number: Optional[int] = None, - participants: Optional[List["_models.CallParticipant"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. - :paramtype correlation_id: str - :keyword sequence_number: The Sequence Number of the event. - :paramtype sequence_number: int - :keyword participants: The list of participants in the call. - :paramtype participants: list[~azure.communication.callautomation.models.CallParticipant] - """ - super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.sequence_number = sequence_number - self.participants = participants - - -class PhoneNumberIdentifierModel(_serialization.Model): - """PhoneNumberIdentifierModel. - - All required parameters must be populated in order to send to Azure. - - :ivar value: Required. - :vartype value: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, value: str, **kwargs: Any) -> None: - """ - :keyword value: Required. - :paramtype value: str - """ - super().__init__(**kwargs) - self.value = value - - -class PlayCanceled(_serialization.Model): - """PlayCanceled. - - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - """ - - _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__( - self, - *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.operation_context = operation_context - - -class PlayCompleted(_serialization.Model): - """PlayCompleted. - - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - """ - - _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - } - - def __init__( - self, - *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, - **kwargs: Any - ) -> None: - """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - """ - super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.operation_context = operation_context - self.result_information = result_information - - -class PlayFailed(_serialization.Model): - """PlayFailed. - - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - """ - - _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - } - - def __init__( - self, - *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, - **kwargs: Any - ) -> None: - """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - """ - super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.operation_context = operation_context - self.result_information = result_information - - -class PlayOptions(_serialization.Model): - """PlayOptions. - - All required parameters must be populated in order to send to Azure. - - :ivar loop: The option to play the provided audio source in loop when set to true. Required. - :vartype loop: bool - """ - - _validation = { - "loop": {"required": True}, - } - - _attribute_map = { - "loop": {"key": "loop", "type": "bool"}, + "cloud": {"key": "cloud", "type": "str"}, } - def __init__(self, *, loop: bool, **kwargs: Any) -> None: + def __init__( + self, + *, + user_id: str, + is_anonymous: Optional[bool] = None, + cloud: Optional[Union[str, "_models.CommunicationCloudEnvironmentModel"]] = None, + **kwargs: Any + ) -> None: """ - :keyword loop: The option to play the provided audio source in loop when set to true. Required. - :paramtype loop: bool + :keyword user_id: The Id of the Microsoft Teams user. If not anonymous, this is the AAD object + Id of the user. Required. + :paramtype user_id: str + :keyword is_anonymous: True if the Microsoft Teams user is anonymous. By default false if + missing. + :paramtype is_anonymous: bool + :keyword cloud: The cloud that the Microsoft Teams user belongs to. By default 'public' if + missing. Known values are: "public", "dod", and "gcch". + :paramtype cloud: str or + ~azure.communication.callautomation.models.CommunicationCloudEnvironmentModel """ super().__init__(**kwargs) - self.loop = loop - + self.user_id = user_id + self.is_anonymous = is_anonymous + self.cloud = cloud -class PlayRequest(_serialization.Model): - """PlayRequest. - All required parameters must be populated in order to send to Azure. +class ParticipantsUpdated(_serialization.Model): + """The participants updated in a call event. - :ivar play_source_info: The source of the audio to be played. Required. - :vartype play_source_info: ~azure.communication.callautomation.models.PlaySource - :ivar play_to: The list of call participants play provided audio to. - Plays to everyone in the call when not provided. - :vartype play_to: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar play_options: Defines options for playing the audio. - :vartype play_options: ~azure.communication.callautomation.models.PlayOptions - :ivar operation_context: The value to identify context of the operation. - :vartype operation_context: str + :ivar call_connection_id: Call connection ID. + :vartype call_connection_id: str + :ivar server_call_id: Server call ID. + :vartype server_call_id: str + :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. + :vartype correlation_id: str + :ivar sequence_number: The Sequence Number of the event. + :vartype sequence_number: int + :ivar participants: The list of participants in the call. + :vartype participants: list[~azure.communication.callautomation.models.CallParticipant] """ - _validation = { - "play_source_info": {"required": True}, - } - _attribute_map = { - "play_source_info": {"key": "playSourceInfo", "type": "PlaySource"}, - "play_to": {"key": "playTo", "type": "[CommunicationIdentifierModel]"}, - "play_options": {"key": "playOptions", "type": "PlayOptions"}, - "operation_context": {"key": "operationContext", "type": "str"}, + "call_connection_id": {"key": "callConnectionId", "type": "str"}, + "server_call_id": {"key": "serverCallId", "type": "str"}, + "correlation_id": {"key": "correlationId", "type": "str"}, + "sequence_number": {"key": "sequenceNumber", "type": "int"}, + "participants": {"key": "participants", "type": "[CallParticipant]"}, } def __init__( self, *, - play_source_info: "_models.PlaySource", - play_to: Optional[List["_models.CommunicationIdentifierModel"]] = None, - play_options: Optional["_models.PlayOptions"] = None, - operation_context: Optional[str] = None, + call_connection_id: Optional[str] = None, + server_call_id: Optional[str] = None, + correlation_id: Optional[str] = None, + sequence_number: Optional[int] = None, + participants: Optional[List["_models.CallParticipant"]] = None, **kwargs: Any ) -> None: """ - :keyword play_source_info: The source of the audio to be played. Required. - :paramtype play_source_info: ~azure.communication.callautomation.models.PlaySource - :keyword play_to: The list of call participants play provided audio to. - Plays to everyone in the call when not provided. - :paramtype play_to: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :keyword play_options: Defines options for playing the audio. - :paramtype play_options: ~azure.communication.callautomation.models.PlayOptions - :keyword operation_context: The value to identify context of the operation. - :paramtype operation_context: str + :keyword call_connection_id: Call connection ID. + :paramtype call_connection_id: str + :keyword server_call_id: Server call ID. + :paramtype server_call_id: str + :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. + :paramtype correlation_id: str + :keyword sequence_number: The Sequence Number of the event. + :paramtype sequence_number: int + :keyword participants: The list of participants in the call. + :paramtype participants: list[~azure.communication.callautomation.models.CallParticipant] """ super().__init__(**kwargs) - self.play_source_info = play_source_info - self.play_to = play_to - self.play_options = play_options - self.operation_context = operation_context + self.call_connection_id = call_connection_id + self.server_call_id = server_call_id + self.correlation_id = correlation_id + self.sequence_number = sequence_number + self.participants = participants -class PlaySource(_serialization.Model): - """PlaySource. +class PhoneNumberIdentifierModel(_serialization.Model): + """A phone number. All required parameters must be populated in order to send to Azure. - :ivar source_type: Defines the type of the play source. Required. Known values are: "file", - "text", and "ssml". - :vartype source_type: str or ~azure.communication.callautomation.models.PlaySourceType - :ivar play_source_id: Defines the identifier to be used for caching related media. - :vartype play_source_id: str - :ivar file_source: Defines the file source info to be used for play. - :vartype file_source: ~azure.communication.callautomation.models.FileSource - :ivar text_source: Defines the text source info to be used for play. - :vartype text_source: ~azure.communication.callautomation.models.TextSource - :ivar ssml_source: Defines the ssml(Speech Synthesis Markup Language) source info to be used - for play. - :vartype ssml_source: ~azure.communication.callautomation.models.SsmlSource + :ivar value: The phone number in E.164 format. Required. + :vartype value: str """ _validation = { - "source_type": {"required": True}, + "value": {"required": True}, } _attribute_map = { - "source_type": {"key": "sourceType", "type": "str"}, - "play_source_id": {"key": "playSourceId", "type": "str"}, - "file_source": {"key": "fileSource", "type": "FileSource"}, - "text_source": {"key": "textSource", "type": "TextSource"}, - "ssml_source": {"key": "ssmlSource", "type": "SsmlSource"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - source_type: Union[str, "_models.PlaySourceType"], - play_source_id: Optional[str] = None, - file_source: Optional["_models.FileSource"] = None, - text_source: Optional["_models.TextSource"] = None, - ssml_source: Optional["_models.SsmlSource"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: str, **kwargs: Any) -> None: """ - :keyword source_type: Defines the type of the play source. Required. Known values are: "file", - "text", and "ssml". - :paramtype source_type: str or ~azure.communication.callautomation.models.PlaySourceType - :keyword play_source_id: Defines the identifier to be used for caching related media. - :paramtype play_source_id: str - :keyword file_source: Defines the file source info to be used for play. - :paramtype file_source: ~azure.communication.callautomation.models.FileSource - :keyword text_source: Defines the text source info to be used for play. - :paramtype text_source: ~azure.communication.callautomation.models.TextSource - :keyword ssml_source: Defines the ssml(Speech Synthesis Markup Language) source info to be used - for play. - :paramtype ssml_source: ~azure.communication.callautomation.models.SsmlSource + :keyword value: The phone number in E.164 format. Required. + :paramtype value: str """ super().__init__(**kwargs) - self.source_type = source_type - self.play_source_id = play_source_id - self.file_source = file_source - self.text_source = text_source - self.ssml_source = ssml_source + self.value = value -class RecognizeCanceled(_serialization.Model): - """RecognizeCanceled. +class PlayCanceled(_serialization.Model): + """PlayCanceled. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -2195,10 +1289,8 @@ def __init__( self.operation_context = operation_context -class RecognizeCompleted(_serialization.Model): - """RecognizeCompleted. - - Variables are only populated by the server, and will be ignored when sending a request. +class PlayCompleted(_serialization.Model): + """PlayCompleted. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -2211,36 +1303,14 @@ class RecognizeCompleted(_serialization.Model): :vartype operation_context: str :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar recognition_type: Determines the sub-type of the recognize operation. - In case of cancel operation the this field is not set and is returned empty. Known values are: - "dtmf", "speech", "speechOrDtmf", and "choices". - :vartype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType - :ivar collect_tones_result: Defines the result for RecognitionType = Dtmf - Would be replaced by DtmfResult after server sdk renewed. - :vartype collect_tones_result: ~azure.communication.callautomation.models.CollectTonesResult - :ivar dtmf_result: Defines the result for RecognitionType = Dtmf. - :vartype dtmf_result: ~azure.communication.callautomation.models.DtmfResult - :ivar choice_result: Defines the result for RecognitionType = Choices. - :vartype choice_result: ~azure.communication.callautomation.models.ChoiceResult - :ivar speech_result: Defines the result for RecognitionType = Speech and SpeechOrDtmf. - :vartype speech_result: ~azure.communication.callautomation.models.SpeechResult """ - _validation = { - "speech_result": {"readonly": True}, - } - _attribute_map = { "call_connection_id": {"key": "callConnectionId", "type": "str"}, "server_call_id": {"key": "serverCallId", "type": "str"}, "correlation_id": {"key": "correlationId", "type": "str"}, "operation_context": {"key": "operationContext", "type": "str"}, "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - "recognition_type": {"key": "recognitionType", "type": "str"}, - "collect_tones_result": {"key": "collectTonesResult", "type": "CollectTonesResult"}, - "dtmf_result": {"key": "dtmfResult", "type": "DtmfResult"}, - "choice_result": {"key": "choiceResult", "type": "ChoiceResult"}, - "speech_result": {"key": "speechResult", "type": "SpeechResult"}, } def __init__( @@ -2251,10 +1321,6 @@ def __init__( correlation_id: Optional[str] = None, operation_context: Optional[str] = None, result_information: Optional["_models.ResultInformation"] = None, - recognition_type: Optional[Union[str, "_models.RecognitionType"]] = None, - collect_tones_result: Optional["_models.CollectTonesResult"] = None, - dtmf_result: Optional["_models.DtmfResult"] = None, - choice_result: Optional["_models.ChoiceResult"] = None, **kwargs: Any ) -> None: """ @@ -2269,17 +1335,6 @@ def __init__( :paramtype operation_context: str :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword recognition_type: Determines the sub-type of the recognize operation. - In case of cancel operation the this field is not set and is returned empty. Known values are: - "dtmf", "speech", "speechOrDtmf", and "choices". - :paramtype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType - :keyword collect_tones_result: Defines the result for RecognitionType = Dtmf - Would be replaced by DtmfResult after server sdk renewed. - :paramtype collect_tones_result: ~azure.communication.callautomation.models.CollectTonesResult - :keyword dtmf_result: Defines the result for RecognitionType = Dtmf. - :paramtype dtmf_result: ~azure.communication.callautomation.models.DtmfResult - :keyword choice_result: Defines the result for RecognitionType = Choices. - :paramtype choice_result: ~azure.communication.callautomation.models.ChoiceResult """ super().__init__(**kwargs) self.call_connection_id = call_connection_id @@ -2287,15 +1342,10 @@ def __init__( self.correlation_id = correlation_id self.operation_context = operation_context self.result_information = result_information - self.recognition_type = recognition_type - self.collect_tones_result = collect_tones_result - self.dtmf_result = dtmf_result - self.choice_result = choice_result - self.speech_result = None -class RecognizeFailed(_serialization.Model): - """RecognizeFailed. +class PlayFailed(_serialization.Model): + """PlayFailed. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -2349,153 +1399,134 @@ def __init__( self.result_information = result_information -class RecognizeOptions(_serialization.Model): - """RecognizeOptions. +class PlayOptions(_serialization.Model): + """PlayOptions. All required parameters must be populated in order to send to Azure. - :ivar interrupt_prompt: Determines if we interrupt the prompt and start recognizing. - :vartype interrupt_prompt: bool - :ivar initial_silence_timeout_in_seconds: Time to wait for first input after prompt (if any). - :vartype initial_silence_timeout_in_seconds: int - :ivar target_participant: Target participant of DTMF tone recognition. Required. - :vartype target_participant: - ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar speech_language: Speech language to be recognized, If not set default is en-US. - :vartype speech_language: str - :ivar dtmf_options: Defines configurations for DTMF. - :vartype dtmf_options: ~azure.communication.callautomation.models.DtmfOptions - :ivar choices: Defines Ivr choices for recognize. - :vartype choices: list[~azure.communication.callautomation.models.Choice] - :ivar speech_options: Defines continuous speech recognition option. - :vartype speech_options: ~azure.communication.callautomation.models.SpeechOptions + :ivar loop: The option to play the provided audio source in loop when set to true. Required. + :vartype loop: bool """ _validation = { - "initial_silence_timeout_in_seconds": {"maximum": 300, "minimum": 0}, - "target_participant": {"required": True}, + "loop": {"required": True}, } _attribute_map = { - "interrupt_prompt": {"key": "interruptPrompt", "type": "bool"}, - "initial_silence_timeout_in_seconds": {"key": "initialSilenceTimeoutInSeconds", "type": "int"}, - "target_participant": {"key": "targetParticipant", "type": "CommunicationIdentifierModel"}, - "speech_language": {"key": "speechLanguage", "type": "str"}, - "dtmf_options": {"key": "dtmfOptions", "type": "DtmfOptions"}, - "choices": {"key": "choices", "type": "[Choice]"}, - "speech_options": {"key": "speechOptions", "type": "SpeechOptions"}, + "loop": {"key": "loop", "type": "bool"}, + } + + def __init__(self, *, loop: bool, **kwargs: Any) -> None: + """ + :keyword loop: The option to play the provided audio source in loop when set to true. Required. + :paramtype loop: bool + """ + super().__init__(**kwargs) + self.loop = loop + + +class PlayRequest(_serialization.Model): + """PlayRequest. + + All required parameters must be populated in order to send to Azure. + + :ivar play_source_info: The source of the audio to be played. Required. + :vartype play_source_info: ~azure.communication.callautomation.models.PlaySource + :ivar play_to: The list of call participants play provided audio to. + Plays to everyone in the call when not provided. + :vartype play_to: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] + :ivar play_options: Defines options for playing the audio. + :vartype play_options: ~azure.communication.callautomation.models.PlayOptions + :ivar operation_context: The value to identify context of the operation. + :vartype operation_context: str + """ + + _validation = { + "play_source_info": {"required": True}, + } + + _attribute_map = { + "play_source_info": {"key": "playSourceInfo", "type": "PlaySource"}, + "play_to": {"key": "playTo", "type": "[CommunicationIdentifierModel]"}, + "play_options": {"key": "playOptions", "type": "PlayOptions"}, + "operation_context": {"key": "operationContext", "type": "str"}, } def __init__( self, *, - target_participant: "_models.CommunicationIdentifierModel", - interrupt_prompt: Optional[bool] = None, - initial_silence_timeout_in_seconds: Optional[int] = None, - speech_language: Optional[str] = None, - dtmf_options: Optional["_models.DtmfOptions"] = None, - choices: Optional[List["_models.Choice"]] = None, - speech_options: Optional["_models.SpeechOptions"] = None, + play_source_info: "_models.PlaySource", + play_to: Optional[List["_models.CommunicationIdentifierModel"]] = None, + play_options: Optional["_models.PlayOptions"] = None, + operation_context: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword interrupt_prompt: Determines if we interrupt the prompt and start recognizing. - :paramtype interrupt_prompt: bool - :keyword initial_silence_timeout_in_seconds: Time to wait for first input after prompt (if - any). - :paramtype initial_silence_timeout_in_seconds: int - :keyword target_participant: Target participant of DTMF tone recognition. Required. - :paramtype target_participant: - ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword speech_language: Speech language to be recognized, If not set default is en-US. - :paramtype speech_language: str - :keyword dtmf_options: Defines configurations for DTMF. - :paramtype dtmf_options: ~azure.communication.callautomation.models.DtmfOptions - :keyword choices: Defines Ivr choices for recognize. - :paramtype choices: list[~azure.communication.callautomation.models.Choice] - :keyword speech_options: Defines continuous speech recognition option. - :paramtype speech_options: ~azure.communication.callautomation.models.SpeechOptions + :keyword play_source_info: The source of the audio to be played. Required. + :paramtype play_source_info: ~azure.communication.callautomation.models.PlaySource + :keyword play_to: The list of call participants play provided audio to. + Plays to everyone in the call when not provided. + :paramtype play_to: + list[~azure.communication.callautomation.models.CommunicationIdentifierModel] + :keyword play_options: Defines options for playing the audio. + :paramtype play_options: ~azure.communication.callautomation.models.PlayOptions + :keyword operation_context: The value to identify context of the operation. + :paramtype operation_context: str """ super().__init__(**kwargs) - self.interrupt_prompt = interrupt_prompt - self.initial_silence_timeout_in_seconds = initial_silence_timeout_in_seconds - self.target_participant = target_participant - self.speech_language = speech_language - self.dtmf_options = dtmf_options - self.choices = choices - self.speech_options = speech_options + self.play_source_info = play_source_info + self.play_to = play_to + self.play_options = play_options + self.operation_context = operation_context -class RecognizeRequest(_serialization.Model): - """RecognizeRequest. +class PlaySource(_serialization.Model): + """PlaySource. All required parameters must be populated in order to send to Azure. - :ivar recognize_input_type: Determines the type of the recognition. Required. Known values are: - "dtmf", "speech", "speechOrDtmf", and "choices". - :vartype recognize_input_type: str or - ~azure.communication.callautomation.models.RecognizeInputType - :ivar play_prompt: The source of the audio to be played for recognition. - :vartype play_prompt: ~azure.communication.callautomation.models.PlaySource - :ivar interrupt_call_media_operation: If set recognize can barge into other existing - queued-up/currently-processing requests. - :vartype interrupt_call_media_operation: bool - :ivar recognize_options: Defines options for recognition. Required. - :vartype recognize_options: ~azure.communication.callautomation.models.RecognizeOptions - :ivar operation_context: The value to identify context of the operation. - :vartype operation_context: str + :ivar source_type: Defines the type of the play source. Required. "file" + :vartype source_type: str or ~azure.communication.callautomation.models.PlaySourceType + :ivar play_source_id: Defines the identifier to be used for caching related media. + :vartype play_source_id: str + :ivar file_source: Defines the file source info to be used for play. + :vartype file_source: ~azure.communication.callautomation.models.FileSource """ _validation = { - "recognize_input_type": {"required": True}, - "recognize_options": {"required": True}, + "source_type": {"required": True}, } _attribute_map = { - "recognize_input_type": {"key": "recognizeInputType", "type": "str"}, - "play_prompt": {"key": "playPrompt", "type": "PlaySource"}, - "interrupt_call_media_operation": {"key": "interruptCallMediaOperation", "type": "bool"}, - "recognize_options": {"key": "recognizeOptions", "type": "RecognizeOptions"}, - "operation_context": {"key": "operationContext", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "play_source_id": {"key": "playSourceId", "type": "str"}, + "file_source": {"key": "fileSource", "type": "FileSource"}, } def __init__( self, *, - recognize_input_type: Union[str, "_models.RecognizeInputType"], - recognize_options: "_models.RecognizeOptions", - play_prompt: Optional["_models.PlaySource"] = None, - interrupt_call_media_operation: Optional[bool] = None, - operation_context: Optional[str] = None, + source_type: Union[str, "_models.PlaySourceType"], + play_source_id: Optional[str] = None, + file_source: Optional["_models.FileSource"] = None, **kwargs: Any ) -> None: """ - :keyword recognize_input_type: Determines the type of the recognition. Required. Known values - are: "dtmf", "speech", "speechOrDtmf", and "choices". - :paramtype recognize_input_type: str or - ~azure.communication.callautomation.models.RecognizeInputType - :keyword play_prompt: The source of the audio to be played for recognition. - :paramtype play_prompt: ~azure.communication.callautomation.models.PlaySource - :keyword interrupt_call_media_operation: If set recognize can barge into other existing - queued-up/currently-processing requests. - :paramtype interrupt_call_media_operation: bool - :keyword recognize_options: Defines options for recognition. Required. - :paramtype recognize_options: ~azure.communication.callautomation.models.RecognizeOptions - :keyword operation_context: The value to identify context of the operation. - :paramtype operation_context: str + :keyword source_type: Defines the type of the play source. Required. "file" + :paramtype source_type: str or ~azure.communication.callautomation.models.PlaySourceType + :keyword play_source_id: Defines the identifier to be used for caching related media. + :paramtype play_source_id: str + :keyword file_source: Defines the file source info to be used for play. + :paramtype file_source: ~azure.communication.callautomation.models.FileSource """ super().__init__(**kwargs) - self.recognize_input_type = recognize_input_type - self.play_prompt = play_prompt - self.interrupt_call_media_operation = interrupt_call_media_operation - self.recognize_options = recognize_options - self.operation_context = operation_context - + self.source_type = source_type + self.play_source_id = play_source_id + self.file_source = file_source -class RecordingStateChanged(_serialization.Model): - """RecordingStateChanged. - Variables are only populated by the server, and will be ignored when sending a request. +class RecognizeCanceled(_serialization.Model): + """RecognizeCanceled. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -2503,26 +1534,16 @@ class RecordingStateChanged(_serialization.Model): :vartype server_call_id: str :ivar correlation_id: Correlation ID for event to call correlation. :vartype correlation_id: str - :ivar recording_id: The call recording id. - :vartype recording_id: str - :ivar state: Known values are: "active" and "inactive". - :vartype state: str or ~azure.communication.callautomation.models.RecordingState - :ivar start_date_time: The time of the recording started. - :vartype start_date_time: ~datetime.datetime + :ivar operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :vartype operation_context: str """ - _validation = { - "recording_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - } - _attribute_map = { "call_connection_id": {"key": "callConnectionId", "type": "str"}, "server_call_id": {"key": "serverCallId", "type": "str"}, "correlation_id": {"key": "correlationId", "type": "str"}, - "recording_id": {"key": "recordingId", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "operation_context": {"key": "operationContext", "type": "str"}, } def __init__( @@ -2531,7 +1552,7 @@ def __init__( call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, - state: Optional[Union[str, "_models.RecordingState"]] = None, + operation_context: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -2541,155 +1562,102 @@ def __init__( :paramtype server_call_id: str :keyword correlation_id: Correlation ID for event to call correlation. :paramtype correlation_id: str - :keyword state: Known values are: "active" and "inactive". - :paramtype state: str or ~azure.communication.callautomation.models.RecordingState + :keyword operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :paramtype operation_context: str """ super().__init__(**kwargs) self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id - self.recording_id = None - self.state = state - self.start_date_time = None - - -class RecordingStateResponse(_serialization.Model): - """RecordingStateResponse. - - :ivar recording_id: - :vartype recording_id: str - :ivar recording_state: Known values are: "active" and "inactive". - :vartype recording_state: str or ~azure.communication.callautomation.models.RecordingState - """ - - _attribute_map = { - "recording_id": {"key": "recordingId", "type": "str"}, - "recording_state": {"key": "recordingState", "type": "str"}, - } - - def __init__( - self, - *, - recording_id: Optional[str] = None, - recording_state: Optional[Union[str, "_models.RecordingState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword recording_id: - :paramtype recording_id: str - :keyword recording_state: Known values are: "active" and "inactive". - :paramtype recording_state: str or ~azure.communication.callautomation.models.RecordingState - """ - super().__init__(**kwargs) - self.recording_id = recording_id - self.recording_state = recording_state - - -class RedirectCallRequest(_serialization.Model): - """The request payload for redirecting the call. - - All required parameters must be populated in order to send to Azure. - - :ivar incoming_call_context: The context associated with the call. Required. - :vartype incoming_call_context: str - :ivar target: The target identity to redirect the call to. Required. - :vartype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar custom_context: Used by customer to send custom context to targets. - :vartype custom_context: ~azure.communication.callautomation.models.CustomContext - """ - - _validation = { - "incoming_call_context": {"required": True}, - "target": {"required": True}, - } - - _attribute_map = { - "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, - "target": {"key": "target", "type": "CommunicationIdentifierModel"}, - "custom_context": {"key": "customContext", "type": "CustomContext"}, - } - - def __init__( - self, - *, - incoming_call_context: str, - target: "_models.CommunicationIdentifierModel", - custom_context: Optional["_models.CustomContext"] = None, - **kwargs: Any - ) -> None: - """ - :keyword incoming_call_context: The context associated with the call. Required. - :paramtype incoming_call_context: str - :keyword target: The target identity to redirect the call to. Required. - :paramtype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword custom_context: Used by customer to send custom context to targets. - :paramtype custom_context: ~azure.communication.callautomation.models.CustomContext - """ - super().__init__(**kwargs) - self.incoming_call_context = incoming_call_context - self.target = target - self.custom_context = custom_context - + self.operation_context = operation_context -class RejectCallRequest(_serialization.Model): - """The request payload for rejecting the call. - All required parameters must be populated in order to send to Azure. +class RecognizeCompleted(_serialization.Model): + """RecognizeCompleted. - :ivar incoming_call_context: The context associated with the call. Required. - :vartype incoming_call_context: str - :ivar call_reject_reason: The rejection reason. Known values are: "none", "busy", and - "forbidden". - :vartype call_reject_reason: str or ~azure.communication.callautomation.models.CallRejectReason + :ivar call_connection_id: Call connection ID. + :vartype call_connection_id: str + :ivar server_call_id: Server call ID. + :vartype server_call_id: str + :ivar correlation_id: Correlation ID for event to call correlation. + :vartype correlation_id: str + :ivar operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :vartype operation_context: str + :ivar result_information: Contains the resulting SIP code, sub-code and message. + :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar recognition_type: Determines the sub-type of the recognize operation. + In case of cancel operation the this field is not set and is returned empty. "dtmf" + :vartype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType + :ivar dtmf_result: Defines the result for RecognitionType = Dtmf. + :vartype dtmf_result: ~azure.communication.callautomation.models.DtmfResult """ - _validation = { - "incoming_call_context": {"required": True}, - } - _attribute_map = { - "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, - "call_reject_reason": {"key": "callRejectReason", "type": "str"}, + "call_connection_id": {"key": "callConnectionId", "type": "str"}, + "server_call_id": {"key": "serverCallId", "type": "str"}, + "correlation_id": {"key": "correlationId", "type": "str"}, + "operation_context": {"key": "operationContext", "type": "str"}, + "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "recognition_type": {"key": "recognitionType", "type": "str"}, + "dtmf_result": {"key": "dtmfResult", "type": "DtmfResult"}, } def __init__( self, *, - incoming_call_context: str, - call_reject_reason: Optional[Union[str, "_models.CallRejectReason"]] = None, + call_connection_id: Optional[str] = None, + server_call_id: Optional[str] = None, + correlation_id: Optional[str] = None, + operation_context: Optional[str] = None, + result_information: Optional["_models.ResultInformation"] = None, + recognition_type: Optional[Union[str, "_models.RecognitionType"]] = None, + dtmf_result: Optional["_models.DtmfResult"] = None, **kwargs: Any ) -> None: """ - :keyword incoming_call_context: The context associated with the call. Required. - :paramtype incoming_call_context: str - :keyword call_reject_reason: The rejection reason. Known values are: "none", "busy", and - "forbidden". - :paramtype call_reject_reason: str or - ~azure.communication.callautomation.models.CallRejectReason + :keyword call_connection_id: Call connection ID. + :paramtype call_connection_id: str + :keyword server_call_id: Server call ID. + :paramtype server_call_id: str + :keyword correlation_id: Correlation ID for event to call correlation. + :paramtype correlation_id: str + :keyword operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :paramtype operation_context: str + :keyword result_information: Contains the resulting SIP code, sub-code and message. + :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword recognition_type: Determines the sub-type of the recognize operation. + In case of cancel operation the this field is not set and is returned empty. "dtmf" + :paramtype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType + :keyword dtmf_result: Defines the result for RecognitionType = Dtmf. + :paramtype dtmf_result: ~azure.communication.callautomation.models.DtmfResult """ super().__init__(**kwargs) - self.incoming_call_context = incoming_call_context - self.call_reject_reason = call_reject_reason + self.call_connection_id = call_connection_id + self.server_call_id = server_call_id + self.correlation_id = correlation_id + self.operation_context = operation_context + self.result_information = result_information + self.recognition_type = recognition_type + self.dtmf_result = dtmf_result -class RemoveParticipantFailed(_serialization.Model): - """The failed to remove participant event. +class RecognizeFailed(_serialization.Model): + """RecognizeFailed. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str :ivar server_call_id: Server call ID. :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. + :ivar correlation_id: Correlation ID for event to call correlation. :vartype correlation_id: str :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. - :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ _attribute_map = { @@ -2698,7 +1666,6 @@ class RemoveParticipantFailed(_serialization.Model): "correlation_id": {"key": "correlationId", "type": "str"}, "operation_context": {"key": "operationContext", "type": "str"}, "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, } def __init__( @@ -2709,7 +1676,6 @@ def __init__( correlation_id: Optional[str] = None, operation_context: Optional[str] = None, result_information: Optional["_models.ResultInformation"] = None, - participant: Optional["_models.CommunicationIdentifierModel"] = None, **kwargs: Any ) -> None: """ @@ -2717,17 +1683,13 @@ def __init__( :paramtype call_connection_id: str :keyword server_call_id: Server call ID. :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. + :keyword correlation_id: Correlation ID for event to call correlation. :paramtype correlation_id: str :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. + :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. - :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) self.call_connection_id = call_connection_id @@ -2735,98 +1697,159 @@ def __init__( self.correlation_id = correlation_id self.operation_context = operation_context self.result_information = result_information - self.participant = participant -class RemoveParticipantRequest(_serialization.Model): - """The remove participant by identifier request. +class RecognizeOptions(_serialization.Model): + """RecognizeOptions. All required parameters must be populated in order to send to Azure. - :ivar participant_to_remove: The participants to be removed from the call. Required. - :vartype participant_to_remove: + :ivar interrupt_prompt: Determines if we interrupt the prompt and start recognizing. + :vartype interrupt_prompt: bool + :ivar initial_silence_timeout_in_seconds: Time to wait for first input after prompt (if any). + :vartype initial_silence_timeout_in_seconds: int + :ivar target_participant: Target participant of DTMF tone recognition. Required. + :vartype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str + :ivar dtmf_options: Defines configurations for DTMF. + :vartype dtmf_options: ~azure.communication.callautomation.models.DtmfOptions """ _validation = { - "participant_to_remove": {"required": True}, + "initial_silence_timeout_in_seconds": {"maximum": 300, "minimum": 0}, + "target_participant": {"required": True}, } _attribute_map = { - "participant_to_remove": {"key": "participantToRemove", "type": "CommunicationIdentifierModel"}, - "operation_context": {"key": "operationContext", "type": "str"}, + "interrupt_prompt": {"key": "interruptPrompt", "type": "bool"}, + "initial_silence_timeout_in_seconds": {"key": "initialSilenceTimeoutInSeconds", "type": "int"}, + "target_participant": {"key": "targetParticipant", "type": "CommunicationIdentifierModel"}, + "dtmf_options": {"key": "dtmfOptions", "type": "DtmfOptions"}, } def __init__( self, *, - participant_to_remove: "_models.CommunicationIdentifierModel", - operation_context: Optional[str] = None, + target_participant: "_models.CommunicationIdentifierModel", + interrupt_prompt: Optional[bool] = None, + initial_silence_timeout_in_seconds: Optional[int] = None, + dtmf_options: Optional["_models.DtmfOptions"] = None, **kwargs: Any ) -> None: """ - :keyword participant_to_remove: The participants to be removed from the call. Required. - :paramtype participant_to_remove: + :keyword interrupt_prompt: Determines if we interrupt the prompt and start recognizing. + :paramtype interrupt_prompt: bool + :keyword initial_silence_timeout_in_seconds: Time to wait for first input after prompt (if + any). + :paramtype initial_silence_timeout_in_seconds: int + :keyword target_participant: Target participant of DTMF tone recognition. Required. + :paramtype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str + :keyword dtmf_options: Defines configurations for DTMF. + :paramtype dtmf_options: ~azure.communication.callautomation.models.DtmfOptions """ super().__init__(**kwargs) - self.participant_to_remove = participant_to_remove - self.operation_context = operation_context + self.interrupt_prompt = interrupt_prompt + self.initial_silence_timeout_in_seconds = initial_silence_timeout_in_seconds + self.target_participant = target_participant + self.dtmf_options = dtmf_options -class RemoveParticipantResponse(_serialization.Model): - """The response payload for removing participants of the call. +class RecognizeRequest(_serialization.Model): + """RecognizeRequest. - :ivar operation_context: The operation context provided by client. + All required parameters must be populated in order to send to Azure. + + :ivar recognize_input_type: Determines the type of the recognition. Required. "dtmf" + :vartype recognize_input_type: str or + ~azure.communication.callautomation.models.RecognizeInputType + :ivar play_prompt: The source of the audio to be played for recognition. + :vartype play_prompt: ~azure.communication.callautomation.models.PlaySource + :ivar interrupt_call_media_operation: If set recognize can barge into other existing + queued-up/currently-processing requests. + :vartype interrupt_call_media_operation: bool + :ivar recognize_options: Defines options for recognition. Required. + :vartype recognize_options: ~azure.communication.callautomation.models.RecognizeOptions + :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str """ + _validation = { + "recognize_input_type": {"required": True}, + "recognize_options": {"required": True}, + } + _attribute_map = { + "recognize_input_type": {"key": "recognizeInputType", "type": "str"}, + "play_prompt": {"key": "playPrompt", "type": "PlaySource"}, + "interrupt_call_media_operation": {"key": "interruptCallMediaOperation", "type": "bool"}, + "recognize_options": {"key": "recognizeOptions", "type": "RecognizeOptions"}, "operation_context": {"key": "operationContext", "type": "str"}, } - def __init__(self, *, operation_context: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + recognize_input_type: Union[str, "_models.RecognizeInputType"], + recognize_options: "_models.RecognizeOptions", + play_prompt: Optional["_models.PlaySource"] = None, + interrupt_call_media_operation: Optional[bool] = None, + operation_context: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword operation_context: The operation context provided by client. + :keyword recognize_input_type: Determines the type of the recognition. Required. "dtmf" + :paramtype recognize_input_type: str or + ~azure.communication.callautomation.models.RecognizeInputType + :keyword play_prompt: The source of the audio to be played for recognition. + :paramtype play_prompt: ~azure.communication.callautomation.models.PlaySource + :keyword interrupt_call_media_operation: If set recognize can barge into other existing + queued-up/currently-processing requests. + :paramtype interrupt_call_media_operation: bool + :keyword recognize_options: Defines options for recognition. Required. + :paramtype recognize_options: ~azure.communication.callautomation.models.RecognizeOptions + :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str """ super().__init__(**kwargs) + self.recognize_input_type = recognize_input_type + self.play_prompt = play_prompt + self.interrupt_call_media_operation = interrupt_call_media_operation + self.recognize_options = recognize_options self.operation_context = operation_context -class RemoveParticipantSucceeded(_serialization.Model): - """The participant removed event. +class RecordingStateChanged(_serialization.Model): + """RecordingStateChanged. + + Variables are only populated by the server, and will be ignored when sending a request. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str :ivar server_call_id: Server call ID. :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. + :ivar correlation_id: Correlation ID for event to call correlation. :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code/sub-code and message from NGC - services. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. - :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar recording_id: The call recording id. + :vartype recording_id: str + :ivar state: Known values are: "active" and "inactive". + :vartype state: str or ~azure.communication.callautomation.models.RecordingState + :ivar start_date_time: The time of the recording started. + :vartype start_date_time: ~datetime.datetime """ + _validation = { + "recording_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + } + _attribute_map = { "call_connection_id": {"key": "callConnectionId", "type": "str"}, "server_call_id": {"key": "serverCallId", "type": "str"}, "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, - "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, + "recording_id": {"key": "recordingId", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } def __init__( @@ -2835,9 +1858,7 @@ def __init__( call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, - participant: Optional["_models.CommunicationIdentifierModel"] = None, + state: Optional[Union[str, "_models.RecordingState"]] = None, **kwargs: Any ) -> None: """ @@ -2845,135 +1866,145 @@ def __init__( :paramtype call_connection_id: str :keyword server_call_id: Server call ID. :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for - skype chain ID. + :keyword correlation_id: Correlation ID for event to call correlation. :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code/sub-code and message from NGC - services. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. - :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword state: Known values are: "active" and "inactive". + :paramtype state: str or ~azure.communication.callautomation.models.RecordingState """ super().__init__(**kwargs) self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id - self.operation_context = operation_context - self.result_information = result_information - self.participant = participant + self.recording_id = None + self.state = state + self.start_date_time = None -class ResultInformation(_serialization.Model): - """ResultInformation. +class RecordingStateResponse(_serialization.Model): + """RecordingStateResponse. - :ivar code: - :vartype code: int - :ivar sub_code: - :vartype sub_code: int - :ivar message: - :vartype message: str + :ivar recording_id: + :vartype recording_id: str + :ivar recording_state: Known values are: "active" and "inactive". + :vartype recording_state: str or ~azure.communication.callautomation.models.RecordingState """ _attribute_map = { - "code": {"key": "code", "type": "int"}, - "sub_code": {"key": "subCode", "type": "int"}, - "message": {"key": "message", "type": "str"}, + "recording_id": {"key": "recordingId", "type": "str"}, + "recording_state": {"key": "recordingState", "type": "str"}, } def __init__( self, *, - code: Optional[int] = None, - sub_code: Optional[int] = None, - message: Optional[str] = None, + recording_id: Optional[str] = None, + recording_state: Optional[Union[str, "_models.RecordingState"]] = None, **kwargs: Any ) -> None: """ - :keyword code: - :paramtype code: int - :keyword sub_code: - :paramtype sub_code: int - :keyword message: - :paramtype message: str + :keyword recording_id: + :paramtype recording_id: str + :keyword recording_state: Known values are: "active" and "inactive". + :paramtype recording_state: str or ~azure.communication.callautomation.models.RecordingState """ super().__init__(**kwargs) - self.code = code - self.sub_code = sub_code - self.message = message + self.recording_id = recording_id + self.recording_state = recording_state -class SendDtmfCompleted(_serialization.Model): - """SendDtmfCompleted. +class RedirectCallRequest(_serialization.Model): + """The request payload for redirecting the call. - :ivar call_connection_id: Call connection ID. - :vartype call_connection_id: str - :ivar server_call_id: Server call ID. - :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. - :vartype correlation_id: str - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + All required parameters must be populated in order to send to Azure. + + :ivar incoming_call_context: The context associated with the call. Required. + :vartype incoming_call_context: str + :ivar target: The target identity to redirect the call to. Required. + :vartype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel + """ + + _validation = { + "incoming_call_context": {"required": True}, + "target": {"required": True}, + } + + _attribute_map = { + "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, + "target": {"key": "target", "type": "CommunicationIdentifierModel"}, + } + + def __init__( + self, *, incoming_call_context: str, target: "_models.CommunicationIdentifierModel", **kwargs: Any + ) -> None: + """ + :keyword incoming_call_context: The context associated with the call. Required. + :paramtype incoming_call_context: str + :keyword target: The target identity to redirect the call to. Required. + :paramtype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel + """ + super().__init__(**kwargs) + self.incoming_call_context = incoming_call_context + self.target = target + + +class RejectCallRequest(_serialization.Model): + """The request payload for rejecting the call. + + All required parameters must be populated in order to send to Azure. + + :ivar incoming_call_context: The context associated with the call. Required. + :vartype incoming_call_context: str + :ivar call_reject_reason: The rejection reason. Known values are: "none", "busy", and + "forbidden". + :vartype call_reject_reason: str or ~azure.communication.callautomation.models.CallRejectReason """ + _validation = { + "incoming_call_context": {"required": True}, + } + _attribute_map = { - "call_connection_id": {"key": "callConnectionId", "type": "str"}, - "server_call_id": {"key": "serverCallId", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "operation_context": {"key": "operationContext", "type": "str"}, - "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, + "call_reject_reason": {"key": "callRejectReason", "type": "str"}, } def __init__( self, *, - call_connection_id: Optional[str] = None, - server_call_id: Optional[str] = None, - correlation_id: Optional[str] = None, - operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, + incoming_call_context: str, + call_reject_reason: Optional[Union[str, "_models.CallRejectReason"]] = None, **kwargs: Any ) -> None: """ - :keyword call_connection_id: Call connection ID. - :paramtype call_connection_id: str - :keyword server_call_id: Server call ID. - :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. - :paramtype correlation_id: str - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword incoming_call_context: The context associated with the call. Required. + :paramtype incoming_call_context: str + :keyword call_reject_reason: The rejection reason. Known values are: "none", "busy", and + "forbidden". + :paramtype call_reject_reason: str or + ~azure.communication.callautomation.models.CallRejectReason """ super().__init__(**kwargs) - self.call_connection_id = call_connection_id - self.server_call_id = server_call_id - self.correlation_id = correlation_id - self.operation_context = operation_context - self.result_information = result_information + self.incoming_call_context = incoming_call_context + self.call_reject_reason = call_reject_reason -class SendDtmfFailed(_serialization.Model): - """SendDtmfFailed. +class RemoveParticipantFailed(_serialization.Model): + """The failed to remove participant event. :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str :ivar server_call_id: Server call ID. :vartype server_call_id: str - :ivar correlation_id: Correlation ID for event to call correlation. + :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. :vartype correlation_id: str :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str :ivar result_information: Contains the resulting SIP code, sub-code and message. :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar participant: Participant. + :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ _attribute_map = { @@ -2982,6 +2013,7 @@ class SendDtmfFailed(_serialization.Model): "correlation_id": {"key": "correlationId", "type": "str"}, "operation_context": {"key": "operationContext", "type": "str"}, "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, } def __init__( @@ -2992,6 +2024,7 @@ def __init__( correlation_id: Optional[str] = None, operation_context: Optional[str] = None, result_information: Optional["_models.ResultInformation"] = None, + participant: Optional["_models.CommunicationIdentifierModel"] = None, **kwargs: Any ) -> None: """ @@ -2999,13 +2032,16 @@ def __init__( :paramtype call_connection_id: str :keyword server_call_id: Server call ID. :paramtype server_call_id: str - :keyword correlation_id: Correlation ID for event to call correlation. + :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. :paramtype correlation_id: str :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str :keyword result_information: Contains the resulting SIP code, sub-code and message. :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword participant: Participant. + :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) self.call_connection_id = call_connection_id @@ -3013,122 +2049,176 @@ def __init__( self.correlation_id = correlation_id self.operation_context = operation_context self.result_information = result_information + self.participant = participant -class SendDtmfRequest(_serialization.Model): - """SendDtmfRequest. +class RemoveParticipantRequest(_serialization.Model): + """The remove participant by identifier request. All required parameters must be populated in order to send to Azure. - :ivar tones: List of tones to be sent to target participant. Required. - :vartype tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - :ivar target_participant: Target participant of send DTMF. Required. - :vartype target_participant: + :ivar participant_to_remove: The participants to be removed from the call. Required. + :vartype participant_to_remove: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar operation_context: The value to identify context of the operation. + :ivar operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. :vartype operation_context: str """ _validation = { - "tones": {"required": True}, - "target_participant": {"required": True}, + "participant_to_remove": {"required": True}, } _attribute_map = { - "tones": {"key": "tones", "type": "[str]"}, - "target_participant": {"key": "targetParticipant", "type": "CommunicationIdentifierModel"}, + "participant_to_remove": {"key": "participantToRemove", "type": "CommunicationIdentifierModel"}, "operation_context": {"key": "operationContext", "type": "str"}, } def __init__( self, *, - tones: List[Union[str, "_models.DtmfTone"]], - target_participant: "_models.CommunicationIdentifierModel", + participant_to_remove: "_models.CommunicationIdentifierModel", operation_context: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword tones: List of tones to be sent to target participant. Required. - :paramtype tones: list[str or ~azure.communication.callautomation.models.DtmfTone] - :keyword target_participant: Target participant of send DTMF. Required. - :paramtype target_participant: + :keyword participant_to_remove: The participants to be removed from the call. Required. + :paramtype participant_to_remove: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword operation_context: The value to identify context of the operation. + :keyword operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. :paramtype operation_context: str """ super().__init__(**kwargs) - self.tones = tones - self.target_participant = target_participant + self.participant_to_remove = participant_to_remove self.operation_context = operation_context -class SpeechOptions(_serialization.Model): - """Options for continuous speech recognition. +class RemoveParticipantResponse(_serialization.Model): + """The response payload for removing participants of the call. - :ivar end_silence_timeout_in_ms: The length of end silence when user stops speaking and - cogservice send response. - :vartype end_silence_timeout_in_ms: int + :ivar operation_context: The operation context provided by client. + :vartype operation_context: str """ _attribute_map = { - "end_silence_timeout_in_ms": {"key": "endSilenceTimeoutInMs", "type": "int"}, + "operation_context": {"key": "operationContext", "type": "str"}, } - def __init__(self, *, end_silence_timeout_in_ms: Optional[int] = None, **kwargs: Any) -> None: + def __init__(self, *, operation_context: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword end_silence_timeout_in_ms: The length of end silence when user stops speaking and - cogservice send response. - :paramtype end_silence_timeout_in_ms: int + :keyword operation_context: The operation context provided by client. + :paramtype operation_context: str """ super().__init__(**kwargs) - self.end_silence_timeout_in_ms = end_silence_timeout_in_ms + self.operation_context = operation_context -class SpeechResult(_serialization.Model): - """The speech status as a result. +class RemoveParticipantSucceeded(_serialization.Model): + """The participant removed event. - :ivar speech: The recognized speech in string. - :vartype speech: str + :ivar call_connection_id: Call connection ID. + :vartype call_connection_id: str + :ivar server_call_id: Server call ID. + :vartype server_call_id: str + :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. + :vartype correlation_id: str + :ivar operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :vartype operation_context: str + :ivar result_information: Contains the resulting SIP code, sub-code and message. + :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar participant: Participant. + :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ _attribute_map = { - "speech": {"key": "speech", "type": "str"}, + "call_connection_id": {"key": "callConnectionId", "type": "str"}, + "server_call_id": {"key": "serverCallId", "type": "str"}, + "correlation_id": {"key": "correlationId", "type": "str"}, + "operation_context": {"key": "operationContext", "type": "str"}, + "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, } - def __init__(self, *, speech: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + call_connection_id: Optional[str] = None, + server_call_id: Optional[str] = None, + correlation_id: Optional[str] = None, + operation_context: Optional[str] = None, + result_information: Optional["_models.ResultInformation"] = None, + participant: Optional["_models.CommunicationIdentifierModel"] = None, + **kwargs: Any + ) -> None: """ - :keyword speech: The recognized speech in string. - :paramtype speech: str + :keyword call_connection_id: Call connection ID. + :paramtype call_connection_id: str + :keyword server_call_id: Server call ID. + :paramtype server_call_id: str + :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. + :paramtype correlation_id: str + :keyword operation_context: Used by customers when calling mid-call actions to correlate the + request to the response event. + :paramtype operation_context: str + :keyword result_information: Contains the resulting SIP code, sub-code and message. + :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword participant: Participant. + :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) - self.speech = speech - + self.call_connection_id = call_connection_id + self.server_call_id = server_call_id + self.correlation_id = correlation_id + self.operation_context = operation_context + self.result_information = result_information + self.participant = participant -class SsmlSource(_serialization.Model): - """SsmlSource. - All required parameters must be populated in order to send to Azure. +class ResultInformation(_serialization.Model): + """ResultInformation. - :ivar ssml_text: Ssml string for the cognitive service to be played. Required. - :vartype ssml_text: str + :ivar code: Code of the current result. This can be helpful to Call Automation team to + troubleshoot the issue if this result was unexpected. + :vartype code: int + :ivar sub_code: Subcode of the current result. This can be helpful to Call Automation team to + troubleshoot the issue if this result was unexpected. + :vartype sub_code: int + :ivar message: Detail message that describes the current result. + :vartype message: str """ - _validation = { - "ssml_text": {"required": True}, - } - _attribute_map = { - "ssml_text": {"key": "ssmlText", "type": "str"}, + "code": {"key": "code", "type": "int"}, + "sub_code": {"key": "subCode", "type": "int"}, + "message": {"key": "message", "type": "str"}, } - def __init__(self, *, ssml_text: str, **kwargs: Any) -> None: + def __init__( + self, + *, + code: Optional[int] = None, + sub_code: Optional[int] = None, + message: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword ssml_text: Ssml string for the cognitive service to be played. Required. - :paramtype ssml_text: str + :keyword code: Code of the current result. This can be helpful to Call Automation team to + troubleshoot the issue if this result was unexpected. + :paramtype code: int + :keyword sub_code: Subcode of the current result. This can be helpful to Call Automation team + to troubleshoot the issue if this result was unexpected. + :paramtype sub_code: int + :keyword message: Detail message that describes the current result. + :paramtype message: str """ super().__init__(**kwargs) - self.ssml_text = ssml_text + self.code = code + self.sub_code = sub_code + self.message = message class StartCallRecordingRequest(_serialization.Model): @@ -3168,8 +2258,6 @@ class StartCallRecordingRequest(_serialization.Model): Channel-Participant mapping details can be found in the metadata of the recording. ///. :vartype channel_affinity: list[~azure.communication.callautomation.models.ChannelAffinity] - :ivar external_storage: Optional property to specify location where recording will be stored. - :vartype external_storage: ~azure.communication.callautomation.models.ExternalStorage """ _validation = { @@ -3187,7 +2275,6 @@ class StartCallRecordingRequest(_serialization.Model): "type": "[CommunicationIdentifierModel]", }, "channel_affinity": {"key": "channelAffinity", "type": "[ChannelAffinity]"}, - "external_storage": {"key": "externalStorage", "type": "ExternalStorage"}, } def __init__( @@ -3200,7 +2287,6 @@ def __init__( recording_format_type: Optional[Union[str, "_models.RecordingFormat"]] = None, audio_channel_participant_ordering: Optional[List["_models.CommunicationIdentifierModel"]] = None, channel_affinity: Optional[List["_models.ChannelAffinity"]] = None, - external_storage: Optional["_models.ExternalStorage"] = None, **kwargs: Any ) -> None: """ @@ -3236,9 +2322,6 @@ def __init__( Channel-Participant mapping details can be found in the metadata of the recording. ///. :paramtype channel_affinity: list[~azure.communication.callautomation.models.ChannelAffinity] - :keyword external_storage: Optional property to specify location where recording will be - stored. - :paramtype external_storage: ~azure.communication.callautomation.models.ExternalStorage """ super().__init__(**kwargs) self.call_locator = call_locator @@ -3248,108 +2331,6 @@ def __init__( self.recording_format_type = recording_format_type self.audio_channel_participant_ordering = audio_channel_participant_ordering self.channel_affinity = channel_affinity - self.external_storage = external_storage - - -class TextSource(_serialization.Model): - """TextSource. - - All required parameters must be populated in order to send to Azure. - - :ivar text: Text for the cognitive service to be played. Required. - :vartype text: str - :ivar source_locale: Source language locale to be played - Refer to available locales here: :code:``. - :vartype source_locale: str - :ivar voice_gender: Voice gender type. Known values are: "male" and "female". - :vartype voice_gender: str or ~azure.communication.callautomation.models.Gender - :ivar voice_name: Voice name to be played - Refer to available Text-to-speech voices here: :code:``. - :vartype voice_name: str - """ - - _validation = { - "text": {"required": True}, - } - - _attribute_map = { - "text": {"key": "text", "type": "str"}, - "source_locale": {"key": "sourceLocale", "type": "str"}, - "voice_gender": {"key": "voiceGender", "type": "str"}, - "voice_name": {"key": "voiceName", "type": "str"}, - } - - def __init__( - self, - *, - text: str, - source_locale: Optional[str] = None, - voice_gender: Optional[Union[str, "_models.Gender"]] = None, - voice_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword text: Text for the cognitive service to be played. Required. - :paramtype text: str - :keyword source_locale: Source language locale to be played - Refer to available locales here: :code:``. - :paramtype source_locale: str - :keyword voice_gender: Voice gender type. Known values are: "male" and "female". - :paramtype voice_gender: str or ~azure.communication.callautomation.models.Gender - :keyword voice_name: Voice name to be played - Refer to available Text-to-speech voices here: :code:``. - :paramtype voice_name: str - """ - super().__init__(**kwargs) - self.text = text - self.source_locale = source_locale - self.voice_gender = voice_gender - self.voice_name = voice_name - - -class ToneInfo(_serialization.Model): - """The information about the tone. - - All required parameters must be populated in order to send to Azure. - - :ivar sequence_id: The sequence id which can be used to determine if the same tone was played - multiple times or if any tones were missed. Required. - :vartype sequence_id: int - :ivar tone: Required. Known values are: "zero", "one", "two", "three", "four", "five", "six", - "seven", "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". - :vartype tone: str or ~azure.communication.callautomation.models.DtmfTone - """ - - _validation = { - "sequence_id": {"required": True}, - "tone": {"required": True}, - } - - _attribute_map = { - "sequence_id": {"key": "sequenceId", "type": "int"}, - "tone": {"key": "tone", "type": "str"}, - } - - def __init__(self, *, sequence_id: int, tone: Union[str, "_models.DtmfTone"], **kwargs: Any) -> None: - """ - :keyword sequence_id: The sequence id which can be used to determine if the same tone was - played multiple times or if any tones were missed. Required. - :paramtype sequence_id: int - :keyword tone: Required. Known values are: "zero", "one", "two", "three", "four", "five", - "six", "seven", "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". - :paramtype tone: str or ~azure.communication.callautomation.models.DtmfTone - """ - super().__init__(**kwargs) - self.sequence_id = sequence_id - self.tone = tone class TransferCallResponse(_serialization.Model): @@ -3381,8 +2362,6 @@ class TransferToParticipantRequest(_serialization.Model): Required. :vartype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar custom_context: Used by customer to send custom context to targets. - :vartype custom_context: ~azure.communication.callautomation.models.CustomContext :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str @@ -3394,7 +2373,6 @@ class TransferToParticipantRequest(_serialization.Model): _attribute_map = { "target_participant": {"key": "targetParticipant", "type": "CommunicationIdentifierModel"}, - "custom_context": {"key": "customContext", "type": "CustomContext"}, "operation_context": {"key": "operationContext", "type": "str"}, } @@ -3402,7 +2380,6 @@ def __init__( self, *, target_participant: "_models.CommunicationIdentifierModel", - custom_context: Optional["_models.CustomContext"] = None, operation_context: Optional[str] = None, **kwargs: Any ) -> None: @@ -3411,77 +2388,10 @@ def __init__( Required. :paramtype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword custom_context: Used by customer to send custom context to targets. - :paramtype custom_context: ~azure.communication.callautomation.models.CustomContext :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str """ super().__init__(**kwargs) self.target_participant = target_participant - self.custom_context = custom_context - self.operation_context = operation_context - - -class UnmuteParticipantsRequest(_serialization.Model): - """The request payload for unmuting participant from the call. - - All required parameters must be populated in order to send to Azure. - - :ivar target_participants: Participants to be unmuted from the call. - Only ACS Users are supported. Required. - :vartype target_participants: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :vartype operation_context: str - """ - - _validation = { - "target_participants": {"required": True}, - } - - _attribute_map = { - "target_participants": {"key": "targetParticipants", "type": "[CommunicationIdentifierModel]"}, - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__( - self, - *, - target_participants: List["_models.CommunicationIdentifierModel"], - operation_context: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword target_participants: Participants to be unmuted from the call. - Only ACS Users are supported. Required. - :paramtype target_participants: - list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :keyword operation_context: Used by customers when calling mid-call actions to correlate the - request to the response event. - :paramtype operation_context: str - """ - super().__init__(**kwargs) - self.target_participants = target_participants - self.operation_context = operation_context - - -class UnmuteParticipantsResponse(_serialization.Model): - """The response payload for unmuting participants from the call. - - :ivar operation_context: The operation context provided by client. - :vartype operation_context: str - """ - - _attribute_map = { - "operation_context": {"key": "operationContext", "type": "str"}, - } - - def __init__(self, *, operation_context: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword operation_context: The operation context provided by client. - :paramtype operation_context: str - """ - super().__init__(**kwargs) self.operation_context = operation_context diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py index 5ca78df56a7a..311cccabb143 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py @@ -6,8 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,6 +19,7 @@ ResourceNotModifiedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -35,13 +38,16 @@ def build_azure_communication_call_automation_service_create_call_request( - *, repeatability_request_id: Optional[str] = None, repeatability_first_sent: Optional[str] = None, **kwargs: Any + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +63,7 @@ def build_azure_communication_call_automation_service_create_call_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -67,13 +73,16 @@ def build_azure_communication_call_automation_service_create_call_request( def build_azure_communication_call_automation_service_answer_call_request( - *, repeatability_request_id: Optional[str] = None, repeatability_first_sent: Optional[str] = None, **kwargs: Any + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +98,7 @@ def build_azure_communication_call_automation_service_answer_call_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -99,13 +108,16 @@ def build_azure_communication_call_automation_service_answer_call_request( def build_azure_communication_call_automation_service_redirect_call_request( - *, repeatability_request_id: Optional[str] = None, repeatability_first_sent: Optional[str] = None, **kwargs: Any + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +133,7 @@ def build_azure_communication_call_automation_service_redirect_call_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -131,13 +143,16 @@ def build_azure_communication_call_automation_service_redirect_call_request( def build_azure_communication_call_automation_service_reject_call_request( - *, repeatability_request_id: Optional[str] = None, repeatability_first_sent: Optional[str] = None, **kwargs: Any + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +168,7 @@ def build_azure_communication_call_automation_service_reject_call_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -166,7 +181,7 @@ def build_call_connection_get_call_request(call_connection_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +205,7 @@ def build_call_connection_hangup_call_request(call_connection_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,13 +229,13 @@ def build_call_connection_terminate_call_request( call_connection_id: str, *, repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +256,7 @@ def build_call_connection_terminate_call_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -252,14 +267,14 @@ def build_call_connection_transfer_to_participant_request( call_connection_id: str, *, repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -280,7 +295,7 @@ def build_call_connection_transfer_to_participant_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -293,7 +308,7 @@ def build_call_connection_get_participants_request(call_connection_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -317,14 +332,14 @@ def build_call_connection_add_participant_request( call_connection_id: str, *, repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -345,7 +360,7 @@ def build_call_connection_add_participant_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -358,14 +373,14 @@ def build_call_connection_remove_participant_request( call_connection_id: str, *, repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,89 +401,7 @@ def build_call_connection_remove_participant_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" - ) - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_call_connection_mute_request( - call_connection_id: str, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/calling/callConnections/{callConnectionId}/participants:mute" - path_format_arguments = { - "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if repeatability_request_id is not None: - _headers["Repeatability-Request-ID"] = _SERIALIZER.header( - "repeatability_request_id", repeatability_request_id, "str" - ) - if repeatability_first_sent is not None: - _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" - ) - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_call_connection_unmute_request( - call_connection_id: str, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/calling/callConnections/{callConnectionId}/participants:unmute" - path_format_arguments = { - "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if repeatability_request_id is not None: - _headers["Repeatability-Request-ID"] = _SERIALIZER.header( - "repeatability_request_id", repeatability_request_id, "str" - ) - if repeatability_first_sent is not None: - _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -483,7 +416,7 @@ def build_call_connection_get_participant_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,7 +442,7 @@ def build_call_media_play_request(call_connection_id: str, **kwargs: Any) -> Htt _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -535,7 +468,7 @@ def build_call_media_cancel_all_media_operations_request(call_connection_id: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -560,7 +493,7 @@ def build_call_media_recognize_request(call_connection_id: str, **kwargs: Any) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -582,95 +515,17 @@ def build_call_media_recognize_request(call_connection_id: str, **kwargs: Any) - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_call_media_start_continuous_dtmf_recognition_request(call_connection_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/calling/callConnections/{callConnectionId}:startContinuousDtmfRecognition" - path_format_arguments = { - "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_call_media_stop_continuous_dtmf_recognition_request(call_connection_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/calling/callConnections/{callConnectionId}:stopContinuousDtmfRecognition" - path_format_arguments = { - "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_call_media_send_dtmf_request(call_connection_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/calling/callConnections/{callConnectionId}:sendDtmf" - path_format_arguments = { - "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_call_recording_start_recording_request( - *, repeatability_request_id: Optional[str] = None, repeatability_first_sent: Optional[str] = None, **kwargs: Any + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +541,7 @@ def build_call_recording_start_recording_request( ) if repeatability_first_sent is not None: _headers["Repeatability-First-Sent"] = _SERIALIZER.header( - "repeatability_first_sent", repeatability_first_sent, "str" + "repeatability_first_sent", repeatability_first_sent, "rfc-1123" ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -699,7 +554,7 @@ def build_call_recording_get_recording_properties_request(recording_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -723,7 +578,7 @@ def build_call_recording_stop_recording_request(recording_id: str, **kwargs: Any _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -747,7 +602,7 @@ def build_call_recording_pause_recording_request(recording_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -771,7 +626,7 @@ def build_call_recording_resume_recording_request(recording_id: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-03-06")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -794,13 +649,7 @@ def build_call_recording_resume_recording_request(recording_id: str, **kwargs: A class AzureCommunicationCallAutomationServiceOperationsMixin(AzureCommunicationCallAutomationServiceMixinABC): @overload def create_call( - self, - create_call_request: _models.CreateCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, create_call_request: _models.CreateCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -808,18 +657,6 @@ def create_call( :param create_call_request: The create call request. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -830,13 +667,7 @@ def create_call( @overload def create_call( - self, - create_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, create_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -844,18 +675,6 @@ def create_call( :param create_call_request: The create call request. Required. :type create_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -866,12 +685,7 @@ def create_call( @distributed_trace def create_call( - self, - create_call_request: Union[_models.CreateCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, create_call_request: Union[_models.CreateCallRequest, IO], **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -880,18 +694,6 @@ def create_call( :param create_call_request: The create call request. Is either a CreateCallRequest type or a IO type. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -922,8 +724,8 @@ def create_call( _json = self._serialize.body(create_call_request, "CreateCallRequest") request = build_azure_communication_call_automation_service_create_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -957,13 +759,7 @@ def create_call( @overload def answer_call( - self, - answer_call_request: _models.AnswerCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, answer_call_request: _models.AnswerCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -971,18 +767,6 @@ def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -993,13 +777,7 @@ def answer_call( @overload def answer_call( - self, - answer_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, answer_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -1007,18 +785,6 @@ def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1029,12 +795,7 @@ def answer_call( @distributed_trace def answer_call( - self, - answer_call_request: Union[_models.AnswerCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, answer_call_request: Union[_models.AnswerCallRequest, IO], **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -1043,18 +804,6 @@ def answer_call( :param answer_call_request: The answer call request. Is either a AnswerCallRequest type or a IO type. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1085,8 +834,8 @@ def answer_call( _json = self._serialize.body(answer_call_request, "AnswerCallRequest") request = build_azure_communication_call_automation_service_answer_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1123,8 +872,6 @@ def redirect_call( # pylint: disable=inconsistent-return-statements self, redirect_call_request: _models.RedirectCallRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> None: @@ -1134,18 +881,6 @@ def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1156,13 +891,7 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @overload def redirect_call( # pylint: disable=inconsistent-return-statements - self, - redirect_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, redirect_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Redirect a call. @@ -1170,18 +899,6 @@ def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1192,12 +909,7 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @distributed_trace def redirect_call( # pylint: disable=inconsistent-return-statements - self, - redirect_call_request: Union[_models.RedirectCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, redirect_call_request: Union[_models.RedirectCallRequest, IO], **kwargs: Any ) -> None: """Redirect a call. @@ -1207,18 +919,6 @@ def redirect_call( # pylint: disable=inconsistent-return-statements or a IO type. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1249,8 +949,8 @@ def redirect_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(redirect_call_request, "RedirectCallRequest") request = build_azure_communication_call_automation_service_redirect_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1280,13 +980,7 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @overload def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: _models.RejectCallRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, reject_call_request: _models.RejectCallRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Reject the call. @@ -1294,18 +988,6 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1316,13 +998,7 @@ def reject_call( # pylint: disable=inconsistent-return-statements @overload def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, reject_call_request: IO, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Reject the call. @@ -1330,18 +1006,6 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1352,12 +1016,7 @@ def reject_call( # pylint: disable=inconsistent-return-statements @distributed_trace def reject_call( # pylint: disable=inconsistent-return-statements - self, - reject_call_request: Union[_models.RejectCallRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, reject_call_request: Union[_models.RejectCallRequest, IO], **kwargs: Any ) -> None: """Reject the call. @@ -1366,18 +1025,6 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Is either a RejectCallRequest type or a IO type. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1408,8 +1055,8 @@ def reject_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(reject_call_request, "RejectCallRequest") request = build_azure_communication_call_automation_service_reject_call_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1459,9 +1106,9 @@ def __init__(self, *args, **kwargs): @distributed_trace def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.CallConnectionProperties: - """Get call connection. + """Get the detail properties of an ongoing call. - Get call connection. + Get the detail properties of an ongoing call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -1516,9 +1163,11 @@ def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.CallConnec def hangup_call( # pylint: disable=inconsistent-return-statements self, call_connection_id: str, **kwargs: Any ) -> None: - """Hangup the call. + """Hang up call automation service from the call. This will make call automation service leave the + call, but does not terminate if there are more than 1 caller in the call. - Hangup the call. + Hang up call automation service from the call. This will make call automation service leave the + call, but does not terminate if there are more than 1 caller in the call. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -1567,12 +1216,7 @@ def hangup_call( # pylint: disable=inconsistent-return-statements @distributed_trace def terminate_call( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, call_connection_id: str, **kwargs: Any ) -> None: """Terminate a call using CallConnectionId. @@ -1580,18 +1224,6 @@ def terminate_call( # pylint: disable=inconsistent-return-statements :param call_connection_id: The terminate call request. Required. :type call_connection_id: str - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1611,8 +1243,8 @@ def terminate_call( # pylint: disable=inconsistent-return-statements request = build_call_connection_terminate_call_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1643,8 +1275,6 @@ def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: _models.TransferToParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -1657,18 +1287,6 @@ def transfer_to_participant( :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1683,8 +1301,6 @@ def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -1696,18 +1312,6 @@ def transfer_to_participant( :type call_connection_id: str :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1721,9 +1325,6 @@ def transfer_to_participant( self, call_connection_id: str, transfer_to_participant_request: Union[_models.TransferToParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, **kwargs: Any ) -> _models.TransferCallResponse: """Transfer the call to a participant. @@ -1736,18 +1337,6 @@ def transfer_to_participant( TransferToParticipantRequest type or a IO type. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1779,8 +1368,8 @@ def transfer_to_participant( request = build_call_connection_transfer_to_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1813,17 +1402,25 @@ def transfer_to_participant( return deserialized @distributed_trace - def get_participants(self, call_connection_id: str, **kwargs: Any) -> _models.GetParticipantsResponse: + def get_participants(self, call_connection_id: str, **kwargs: Any) -> Iterable["_models.CallParticipant"]: """Get participants from a call. Get participants from a call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str - :return: GetParticipantsResponse - :rtype: ~azure.communication.callautomation.models.GetParticipantsResponse + :return: An iterator like instance of CallParticipant + :rtype: + ~azure.core.paging.ItemPaged[~azure.communication.callautomation.models.CallParticipant] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.GetParticipantsResponse] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1832,40 +1429,70 @@ def get_participants(self, call_connection_id: str, **kwargs: Any) -> _models.Ge } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.GetParticipantsResponse] = kwargs.pop("cls", None) - - request = build_call_connection_get_participants_request( - call_connection_id=call_connection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize("GetParticipantsResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + def prepare_request(next_link=None): + if not next_link: + + request = build_call_connection_get_participants_request( + call_connection_id=call_connection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.GetParticipantsResponse, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @overload def add_participant( @@ -1873,31 +1500,17 @@ def add_participant( call_connection_id: str, add_participant_request: _models.AddParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1912,31 +1525,17 @@ def add_participant( call_connection_id: str, add_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1947,35 +1546,17 @@ def add_participant( @distributed_trace def add_participant( - self, - call_connection_id: str, - add_participant_request: Union[_models.AddParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, call_connection_id: str, add_participant_request: Union[_models.AddParticipantRequest, IO], **kwargs: Any ) -> _models.AddParticipantResponse: - """Add participants to the call. + """Add a participant to the call. - Add participants to the call. + Add a participant to the call. :param call_connection_id: The call connection Id. Required. :type call_connection_id: str :param add_participant_request: Is either a AddParticipantRequest type or a IO type. Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2007,8 +1588,8 @@ def add_participant( request = build_call_connection_add_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -2046,32 +1627,18 @@ def remove_participant( call_connection_id: str, remove_participant_request: _models.RemoveParticipantRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2086,31 +1653,17 @@ def remove_participant( call_connection_id: str, remove_participant_request: IO, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2124,14 +1677,11 @@ def remove_participant( self, call_connection_id: str, remove_participant_request: Union[_models.RemoveParticipantRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, **kwargs: Any ) -> _models.RemoveParticipantResponse: - """Remove participant from the call using identifier. + """Remove a participant from the call using identifier. - Remove participant from the call using identifier. + Remove a participant from the call using identifier. :param call_connection_id: The call connection id. Required. :type call_connection_id: str @@ -2139,18 +1689,6 @@ def remove_participant( RemoveParticipantRequest type or a IO type. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2182,8 +1720,8 @@ def remove_participant( request = build_call_connection_remove_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -2215,356 +1753,6 @@ def remove_participant( return deserialized - @overload - def mute( - self, - call_connection_id: str, - mute_participants_request: _models.MuteParticipantsRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. - - Mute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Required. - :type mute_participants_request: - ~azure.communication.callautomation.models.MuteParticipantsRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def mute( - self, - call_connection_id: str, - mute_participants_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. - - Mute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Required. - :type mute_participants_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def mute( - self, - call_connection_id: str, - mute_participants_request: Union[_models.MuteParticipantsRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any - ) -> _models.MuteParticipantsResponse: - """Mute participants from the call using identifier. - - Mute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param mute_participants_request: The participants to be muted from the call. Is either a - MuteParticipantsRequest type or a IO type. Required. - :type mute_participants_request: - ~azure.communication.callautomation.models.MuteParticipantsRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: MuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.MuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MuteParticipantsResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(mute_participants_request, (IOBase, bytes)): - _content = mute_participants_request - else: - _json = self._serialize.body(mute_participants_request, "MuteParticipantsRequest") - - request = build_call_connection_mute_request( - call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize("MuteParticipantsResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - @overload - def unmute( - self, - call_connection_id: str, - unmute_participants_request: _models.UnmuteParticipantsRequest, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. - - Unmute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Required. - :type unmute_participants_request: - ~azure.communication.callautomation.models.UnmuteParticipantsRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def unmute( - self, - call_connection_id: str, - unmute_participants_request: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. - - Unmute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Required. - :type unmute_participants_request: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def unmute( - self, - call_connection_id: str, - unmute_participants_request: Union[_models.UnmuteParticipantsRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any - ) -> _models.UnmuteParticipantsResponse: - """Unmute participants from the call using identifier. - - Unmute participants from the call using identifier. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param unmute_participants_request: The participants to be unmuted from the call. Is either a - UnmuteParticipantsRequest type or a IO type. Required. - :type unmute_participants_request: - ~azure.communication.callautomation.models.UnmuteParticipantsRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: UnmuteParticipantsResponse - :rtype: ~azure.communication.callautomation.models.UnmuteParticipantsResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnmuteParticipantsResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(unmute_participants_request, (IOBase, bytes)): - _content = unmute_participants_request - else: - _json = self._serialize.body(unmute_participants_request, "UnmuteParticipantsRequest") - - request = build_call_connection_unmute_request( - call_connection_id=call_connection_id, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize("UnmuteParticipantsResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - @distributed_trace def get_participant( self, call_connection_id: str, participant_raw_id: str, **kwargs: Any @@ -2929,374 +2117,6 @@ def recognize( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - @overload - def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: _models.ContinuousDtmfRecognitionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: Union[_models.ContinuousDtmfRecognitionRequest, IO], - **kwargs: Any - ) -> None: - """Start continuous Dtmf recognition by subscribing to tones. - - Start continuous Dtmf recognition by subscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Is either a - ContinuousDtmfRecognitionRequest type or a IO type. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(continuous_dtmf_recognition_request, (IOBase, bytes)): - _content = continuous_dtmf_recognition_request - else: - _json = self._serialize.body(continuous_dtmf_recognition_request, "ContinuousDtmfRecognitionRequest") - - request = build_call_media_start_continuous_dtmf_recognition_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: _models.ContinuousDtmfRecognitionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Required. - :type continuous_dtmf_recognition_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - continuous_dtmf_recognition_request: Union[_models.ContinuousDtmfRecognitionRequest, IO], - **kwargs: Any - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - Stop continuous Dtmf recognition by unsubscribing to tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param continuous_dtmf_recognition_request: The continuous recognize request. Is either a - ContinuousDtmfRecognitionRequest type or a IO type. Required. - :type continuous_dtmf_recognition_request: - ~azure.communication.callautomation.models.ContinuousDtmfRecognitionRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(continuous_dtmf_recognition_request, (IOBase, bytes)): - _content = continuous_dtmf_recognition_request - else: - _json = self._serialize.body(continuous_dtmf_recognition_request, "ContinuousDtmfRecognitionRequest") - - request = build_call_media_stop_continuous_dtmf_recognition_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - def send_dtmf( # pylint: disable=inconsistent-return-statements - self, - call_connection_id: str, - send_dtmf_request: _models.SendDtmfRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Required. - :type send_dtmf_request: ~azure.communication.callautomation.models.SendDtmfRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def send_dtmf( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, send_dtmf_request: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Required. - :type send_dtmf_request: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def send_dtmf( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, send_dtmf_request: Union[_models.SendDtmfRequest, IO], **kwargs: Any - ) -> None: - """Send dtmf tones. - - Send dtmf tones. - - :param call_connection_id: The call connection id. Required. - :type call_connection_id: str - :param send_dtmf_request: The send dtmf request. Is either a SendDtmfRequest type or a IO type. - Required. - :type send_dtmf_request: ~azure.communication.callautomation.models.SendDtmfRequest or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(send_dtmf_request, (IOBase, bytes)): - _content = send_dtmf_request - else: - _json = self._serialize.body(send_dtmf_request, "SendDtmfRequest") - - request = build_call_media_send_dtmf_request( - call_connection_id=call_connection_id, - content_type=content_type, - api_version=self._config.api_version, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - class CallRecordingOperations: """ @@ -3322,8 +2142,6 @@ def start_recording( self, start_call_recording: _models.StartCallRecordingRequest, *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: @@ -3334,18 +2152,6 @@ def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3356,13 +2162,7 @@ def start_recording( @overload def start_recording( - self, - start_call_recording: IO, - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, start_call_recording: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -3370,18 +2170,6 @@ def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3392,12 +2180,7 @@ def start_recording( @distributed_trace def start_recording( - self, - start_call_recording: Union[_models.StartCallRecordingRequest, IO], - *, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[str] = None, - **kwargs: Any + self, start_call_recording: Union[_models.StartCallRecordingRequest, IO], **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -3407,18 +2190,6 @@ def start_recording( StartCallRecordingRequest type or a IO type. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest or IO - :keyword repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :paramtype repeatability_request_id: str - :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :paramtype repeatability_first_sent: str :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -3449,8 +2220,8 @@ def start_recording( _json = self._serialize.body(start_call_recording, "StartCallRecordingRequest") request = build_call_recording_start_recording_request( - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, + repeatability_request_id=self._config.repeatability_request_id, + repeatability_first_sent=self._config.repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py index 60e3fd0e8d1e..50e07f1a7aa3 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py @@ -6,7 +6,6 @@ from typing import List, Optional, Union, TYPE_CHECKING, Dict from ._generated.models import ( CallLocator, - MediaStreamingConfiguration as MediaStreamingConfigurationRest, FileSource as FileSourceInternal, PlaySource as PlaySourceInternal, ChannelAffinity as ChannelAffinityInternal @@ -27,9 +26,6 @@ ) if TYPE_CHECKING: from ._generated.models._enums import ( - MediaStreamingTransportType, - MediaStreamingContentType, - MediaStreamingAudioChannelType, CallConnectionState, RecordingState ) @@ -52,10 +48,6 @@ class CallInvite(object): :vartype source_caller_id_number: ~azure.communication.callautomation.PhoneNumberIdentifier :ivar source_display_name: Set display name for caller :vartype source_display_name: str - :ivar sip_headers: Custom context for PSTN - :vartype sip_headers: dict[str, str] - :ivar voip_headers: Custom context for VOIP - :vartype voip_headers: dict[str, str] """ def __init__( self, @@ -63,8 +55,6 @@ def __init__( *, source_caller_id_number: Optional[PhoneNumberIdentifier] = None, source_display_name: Optional[str] = None, - sip_headers: Optional[Dict[str, str]] = None, - voip_headers: Optional[Dict[str, str]] = None, **kwargs ): """CallInvitation that can be used to do outbound calls, such as creating call. @@ -76,17 +66,11 @@ def __init__( :paramtype source_caller_id_number: ~azure.communication.callautomation.PhoneNumberIdentifier :keyword source_display_name: Set display name for caller :paramtype source_display_name: str - :keyword sip_headers: Custom context for PSTN calls - :paramtype sip_headers: str - :keyword voip_headers: Custom context for VOIP calls - :paramtype voip_headers: str """ super().__init__(**kwargs) self.target = target self.source_caller_id_number = source_caller_id_number self.source_display_name = source_display_name - self.sip_headers = sip_headers - self.voip_headers = voip_headers class ServerCallLocator(object): """The locator to locate ongoing call, using server call id. @@ -204,51 +188,6 @@ def _to_generated(self): play_source_id=self.play_source_id ) -class MediaStreamingConfiguration(object): - """Configuration of Media streaming. - - :ivar transport_url: Transport URL for media streaming. - :vartype transport_url: str - :ivar transport_type: The type of transport to be used for media streaming. - :vartype transport_type: str or ~azure.communication.callautomation.MediaStreamingTransportType - :ivar content_type: Content type to stream, eg. audio, audio/video. - :vartype content_type: str or ~azure.communication.callautomation.MediaStreamingContentType - :ivar audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio. - :vartype audio_channel_type: str or ~azure.communication.callautomation.MediaStreamingAudioChannelType - """ - def __init__( - self, - transport_url: str, - transport_type: Union[str, 'MediaStreamingTransportType'], - content_type: Union[str, 'MediaStreamingContentType'], - audio_channel_type: Union[str, 'MediaStreamingAudioChannelType'], - **kwargs - ): - """Configuration of Media streaming details. - - :param transport_url: Transport URL for media streaming. - :type transport_url: str - :param transport_type: The type of transport to be used for media streaming. - :type transport_type: str or ~azure.communication.callautomation.MediaStreamingTransportType - :param content_type: Content type to stream, eg. audio, audio/video. - :type content_type: str or ~azure.communication.callautomation.MediaStreamingContentType - :param audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio. - :type audio_channel_type: str or ~azure.communication.callautomation.MediaStreamingAudioChannelType - """ - super().__init__(**kwargs) - self.transport_url = transport_url - self.transport_type = transport_type - self.content_type = content_type - self.audio_channel_type = audio_channel_type - - def to_generated(self): - return MediaStreamingConfigurationRest( - transport_url=self.transport_url, - transport_type=self.transport_type, - content_type=self.content_type, - audio_channel_type=self.audio_channel_type - ) - class CallConnectionProperties(): # type: ignore # pylint: disable=too-many-instance-attributes """ Detailed properties of the call. @@ -262,8 +201,6 @@ class CallConnectionProperties(): # type: ignore # pylint: disable=too-many-inst :vartype call_connection_state: str or ~azure.communication.callautomation.CallConnectionState :ivar callback_url: The callback URL. :vartype callback_url: str - :ivar media_subscription_id: SubscriptionId for media streaming. - :vartype media_subscription_id: str :ivar source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN participant being invited. @@ -271,12 +208,12 @@ class CallConnectionProperties(): # type: ignore # pylint: disable=too-many-inst :vartype source_caller_id_number: ~azure.communication.callautomation.PhoneNumberIdentifier :ivar source_display_name: Display name of the call if dialing out. :vartype source_display_name: str - :ivar source_identity: Source identity of the caller. - :vartype source_identity: ~azure.communication.callautomation.CommunicationIdentifier + :ivar source: Source identity of the caller. + :vartype source: ~azure.communication.callautomation.CommunicationIdentifier :ivar correlation_id: Correlation ID of the call :vartype correlation_id: str - :ivar answered_by_identifier: The identifier that answered the call - :vartype answered_by_identifier: ~azure.communication.callautomation.CommunicationUserIdentifier + :ivar answered_by: The identifier that answered the call + :vartype answered_by: ~azure.communication.callautomation.CommunicationUserIdentifier """ def __init__( self, @@ -287,12 +224,11 @@ def __init__( call_connection_state: Optional[Union[str, 'CallConnectionState']] = None, callback_url: Optional[str] = None, - media_subscription_id: Optional[str] = None, source_caller_id_number: Optional[PhoneNumberIdentifier] = None, source_display_name: Optional[str] = None, - source_identity: Optional[CommunicationIdentifier] = None, + source: Optional[CommunicationIdentifier] = None, correlation_id: Optional[str] = None, - answered_by_identifier: Optional[CommunicationUserIdentifier] = None, + answered_by: Optional[CommunicationUserIdentifier] = None, **kwargs ): super().__init__(**kwargs) @@ -301,12 +237,11 @@ def __init__( self.targets = targets self.call_connection_state = call_connection_state self.callback_url = callback_url - self.media_subscription_id = media_subscription_id self.source_caller_id_number = source_caller_id_number self.source_display_name = source_display_name - self.source_identity = source_identity + self.source = source self.correlation_id = correlation_id - self.answered_by_identifier = answered_by_identifier + self.answered_by = answered_by @classmethod def _from_generated(cls, call_connection_properties_generated: 'CallConnectionPropertiesRest'): @@ -320,19 +255,18 @@ def _from_generated(cls, call_connection_properties_generated: 'CallConnectionPr targets=target_models, call_connection_state=call_connection_properties_generated.call_connection_state, callback_url=call_connection_properties_generated.callback_uri, - media_subscription_id=call_connection_properties_generated.media_subscription_id, source_caller_id_number=deserialize_phone_identifier( call_connection_properties_generated.source_caller_id_number) if call_connection_properties_generated.source_caller_id_number else None, source_display_name=call_connection_properties_generated.source_display_name, - source_identity=deserialize_identifier(call_connection_properties_generated.source_identity) - if call_connection_properties_generated.source_identity + source=deserialize_identifier(call_connection_properties_generated.source) + if call_connection_properties_generated.source else None, correlation_id=call_connection_properties_generated.correlation_id, - answered_by_identifier=deserialize_comm_user_identifier( - call_connection_properties_generated.answered_by_identifier) - if call_connection_properties_generated.answered_by_identifier + answered_by=deserialize_comm_user_identifier( + call_connection_properties_generated.answered_by) + if call_connection_properties_generated.answered_by else None ) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py index 5289206b8367..0b193e785b2d 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py @@ -20,8 +20,7 @@ AnswerCallRequest, RedirectCallRequest, RejectCallRequest, - StartCallRecordingRequest, - CustomContext + StartCallRecordingRequest ) from .._models import ( CallConnectionProperties, @@ -39,8 +38,7 @@ from .._models import ( CallInvite, ServerCallLocator, - GroupCallLocator, - MediaStreamingConfiguration + GroupCallLocator ) from azure.core.credentials_async import ( AsyncTokenCredential, @@ -57,8 +55,7 @@ CallRejectReason, RecordingContent, RecordingChannel, - RecordingFormat, - RecordingStorage + RecordingFormat ) from azure.core.exceptions import HttpResponseError @@ -158,8 +155,6 @@ async def create_call( callback_url: str, *, operation_context: Optional[str] = None, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, **kwargs ) -> CallConnectionProperties: """Create a call connection request to a target identity. @@ -170,19 +165,10 @@ async def create_call( :type callback_url: str :keyword operation_context: Value that can be used to track the call and its associated events. :paramtype operation_context: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The identifier of the Cognitive Service resource assigned to this call. - :paramtype azure_cognitive_services_endpoint_url: str :return: CallConnectionProperties :rtype: ~azure.communication.callautomation.CallConnectionProperties :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None create_call_request = CreateCallRequest( targets=[serialize_identifier(target_participant.target)], callback_uri=callback_url, @@ -192,10 +178,6 @@ async def create_call( source_identity=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, - custom_context=user_custom_context ) result = await self._client.create_call( @@ -216,10 +198,6 @@ async def create_group_call( source_caller_id_number: Optional['PhoneNumberIdentifier'] = None, source_display_name: Optional[str] = None, operation_context: Optional[str] = None, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, - sip_headers: Optional[Dict[str, str]] = None, - voip_headers: Optional[Dict[str, str]] = None, **kwargs ) -> CallConnectionProperties: """ Create a call connection request to a list of multiple target identities. @@ -236,22 +214,10 @@ async def create_group_call( :paramtype source_display_name: str :keyword operation_context: Value that can be used to track the call and its associated events. :paramtype operation_context: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The identifier of the Cognitive Service resource assigned to this call. - :paramtype azure_cognitive_services_endpoint_url: str - :keyword sip_headers: Sip Headers for PSTN Call - :paramtype sip_headers: Dict[str, str] - :keyword voip_headers: Voip Headers for Voip Call - :paramtype voip_headers: Dict[str, str] :return: CallConnectionProperties :rtype: ~azure.communication.callautomation.CallConnectionProperties :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=voip_headers, sip_headers=sip_headers) if sip_headers or voip_headers else None - create_call_request = CreateCallRequest( targets=[serialize_identifier(identifier) for identifier in target_participants], @@ -262,10 +228,6 @@ async def create_group_call( source_identity=serialize_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, - custom_context=user_custom_context, ) result = await self._client.create_call( @@ -283,8 +245,6 @@ async def answer_call( incoming_call_context: str, callback_url: str, *, - media_streaming_configuration: Optional['MediaStreamingConfiguration'] = None, - azure_cognitive_services_endpoint_url: Optional[str] = None, operation_context: Optional[str] = None, **kwargs ) -> CallConnectionProperties: @@ -295,11 +255,6 @@ async def answer_call( :type incoming_call_context: str :param callback_url: The call back url for receiving events. :type callback_url: str - :keyword media_streaming_configuration: Media Streaming Configuration. - :paramtype media_streaming_configuration: ~azure.communication.callautomation.MediaStreamingConfiguration - :keyword azure_cognitive_services_endpoint_url: - The endpoint url of the Azure Cognitive Services resource attached. - :paramtype azure_cognitive_services_endpoint_url: str :keyword operation_context: The operation context. :paramtype operation_context: str :return: CallConnectionProperties @@ -309,9 +264,6 @@ async def answer_call( answer_call_request = AnswerCallRequest( incoming_call_context=incoming_call_context, callback_uri=callback_url, - media_streaming_configuration=media_streaming_configuration.to_generated( - ) if media_streaming_configuration else None, - azure_cognitive_services_endpoint_url=azure_cognitive_services_endpoint_url, answered_by_identifier=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context @@ -344,15 +296,9 @@ async def redirect_call( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None - redirect_call_request = RedirectCallRequest( incoming_call_context=incoming_call_context, - target=serialize_identifier(target_participant.target), - custom_context=user_custom_context + target=serialize_identifier(target_participant.target) ) await self._client.redirect_call( @@ -401,9 +347,7 @@ async def start_recording( recording_channel_type: Optional[Union[str, 'RecordingChannel']] = None, recording_format_type: Optional[Union[str, 'RecordingFormat']] = None, audio_channel_participant_ordering: Optional[List['CommunicationIdentifier']] = None, - recording_storage_type: Optional[Union[str, 'RecordingStorage']] = None, channel_affinity: Optional[List['ChannelAffinity']] = None, - external_storage_location: Optional[str] = None, **kwargs ) -> RecordingProperties: """Start recording for a ongoing call. Locate the call with call locator. @@ -426,17 +370,11 @@ async def start_recording( which participant first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. :paramtype audio_channel_participant_ordering: list[~azure.communication.callautomation.CommunicationIdentifier] - :keyword recording_storage_type: Recording storage mode. - ``External`` enables bring your own storage. - :paramtype recording_storage_type: str :keyword channel_affinity: The channel affinity of call recording When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned. Channel-Participant mapping details can be found in the metadata of the recording. :paramtype channel_affinity: list[~azure.communication.callautomation.ChannelAffinity] - :keyword external_storage_location: The location where recording is stored, - when RecordingStorageType is set to 'BlobStorage'. - :paramtype external_storage_location: str or ~azure.communication.callautomation.RecordingStorage :return: RecordingProperties :rtype: ~azure.communication.callautomation.RecordingProperties :raises ~azure.core.exceptions.HttpResponseError: @@ -456,8 +394,6 @@ async def start_recording( recording_channel_type = recording_channel_type, recording_format_type = recording_format_type, audio_channel_participant_ordering = audio_channel_participant_ordering, - recording_storage_type = recording_storage_type, - external_storage_location = external_storage_location, channel_affinity = channel_affinity_internal, repeatability_first_sent=get_repeatability_timestamp(), repeatability_request_id=get_repeatability_guid() diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py index 3feee76871d4..7451b04f5a2d 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py @@ -30,9 +30,6 @@ TransferToParticipantRequest, PlayRequest, RecognizeRequest, - ContinuousDtmfRecognitionRequest, - SendDtmfRequest, - CustomContext, DtmfOptions, PlayOptions, RecognizeOptions, @@ -198,15 +195,13 @@ def list_participants(self, **kwargs) -> AsyncItemPaged[CallParticipant]: :rtype: ItemPaged[azure.communication.callautomation.CallParticipant] :raises ~azure.core.exceptions.HttpResponseError: """ - return self._call_connection_client.get_participants(self._call_connection_id, **kwargs).values + return self._call_connection_client.get_participants(self._call_connection_id, **kwargs) @distributed_trace_async async def transfer_call_to_participant( self, target_participant: 'CommunicationIdentifier', *, - sip_headers: Optional[Dict[str, str]] = None, - voip_headers: Optional[Dict[str, str]] = None, operation_context: Optional[str] = None, **kwargs ) -> TransferCallResult: @@ -214,23 +209,15 @@ async def transfer_call_to_participant( :param target_participant: The transfer target. :type target_participant: CommunicationIdentifier - :keyword sip_headers: Custom context for PSTN - :paramtype sip_headers: dict[str, str] - :keyword voip_headers: Custom context for VOIP - :paramtype voip_headers: dict[str, str] :keyword operation_context: Value that can be used to track the call and its associated events. :paramtype operation_context: str :return: TransferCallResult :rtype: ~azure.communication.callautomation.TransferCallResult :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=voip_headers, - sip_headers=sip_headers - ) if sip_headers or voip_headers else None request = TransferToParticipantRequest( target_participant=serialize_identifier(target_participant), - custom_context=user_custom_context, operation_context=operation_context) + operation_context=operation_context) return await self._call_connection_client.transfer_to_participant( self._call_connection_id, request, @@ -260,16 +247,11 @@ async def add_participant( :rtype: ~azure.communication.callautomation.AddParticipantResult :raises ~azure.core.exceptions.HttpResponseError: """ - user_custom_context = CustomContext( - voip_headers=target_participant.voip_headers, - sip_headers=target_participant.sip_headers - ) if target_participant.sip_headers or target_participant.voip_headers else None add_participant_request = AddParticipantRequest( participant_to_add=serialize_identifier(target_participant.target), source_caller_id_number=serialize_phone_identifier( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, - custom_context=user_custom_context, invitation_timeout=invitation_timeout, operation_context=operation_context) @@ -453,91 +435,6 @@ async def cancel_all_media_operations( await self._call_media_client.cancel_all_media_operations( self._call_connection_id, **kwargs) - @distributed_trace_async - async def start_continuous_dtmf_recognition( - self, - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """ Start continuous Dtmf recognition by subscribing to tones. - - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: Value that can be used to track the call and its associated events. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - await self._call_media_client.start_continuous_dtmf_recognition( - self._call_connection_id, - continuous_dtmf_recognition_request, - **kwargs) - - @distributed_trace_async - async def stop_continuous_dtmf_recognition( - self, - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """Stop continuous Dtmf recognition by unsubscribing to tones. - - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: Value that can be used to track the call and its associated events. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - await self._call_media_client.stop_continuous_dtmf_recognition( - self._call_connection_id, - continuous_dtmf_recognition_request, - **kwargs) - - @distributed_trace_async - async def send_dtmf( - self, - tones: List[Union[str, 'DtmfTone']], - target_participant: 'CommunicationIdentifier', - *, - operation_context: Optional[str] = None, - **kwargs - ) -> None: - """Send Dtmf tones to the call. - - :param tones: List of tones to be sent to target participant. - :type tones:list[str or ~azure.communication.callautomation.DtmfTone] - :param target_participant: Target participant. - :type target_participant: ~azure.communication.callautomation.CommunicationIdentifier - :keyword operation_context: Value that can be used to track the call and its associated events. - :paramtype operation_context: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - send_dtmf_request = SendDtmfRequest( - tones=tones, - target_participant=serialize_identifier(target_participant), - operation_context=operation_context) - - await self._call_media_client.send_dtmf( - self._call_connection_id, - send_dtmf_request, - **kwargs) - async def __aenter__(self) -> "CallConnectionClient": await self._client.__aenter__() return self diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py index 8057274cb565..4e5afd302abe 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py @@ -18,9 +18,7 @@ RecognizeRequest, RecognizeOptions, DtmfOptions, - ContinuousDtmfRecognitionRequest, - DtmfTone, - SendDtmfRequest, + DtmfTone ) from azure.communication.callautomation._generated.models._enums import ( RecognizeInputType @@ -153,64 +151,4 @@ def test_cancel(self): mock_cancel_all.assert_called_once() actual_call_connection_id = mock_cancel_all.call_args[0][0] - self.assertEqual(self.call_connection_id, actual_call_connection_id) - - def test_start_continuous_dtmf_recognition(self): - mock_start_continuous_dtmf_recognition = Mock() - self.call_media_operations.start_continuous_dtmf_recognition = mock_start_continuous_dtmf_recognition - self.call_connection_client.start_continuous_dtmf_recognition(target_participant=self.target_user) - - expected_continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(self.target_user)) - - mock_start_continuous_dtmf_recognition.assert_called_once() - actual_call_connection_id = mock_start_continuous_dtmf_recognition.call_args[0][0] - actual_start_continuous_dtmf_recognition = mock_start_continuous_dtmf_recognition.call_args[0][1] - - self.assertEqual(self.call_connection_id, actual_call_connection_id) - self.assertEqual(expected_continuous_dtmf_recognition_request.target_participant, - actual_start_continuous_dtmf_recognition.target_participant) - self.assertEqual(expected_continuous_dtmf_recognition_request.operation_context, - actual_start_continuous_dtmf_recognition.operation_context) - - def test_stop_continuous_dtmf_recognition(self): - mock_stop_continuous_dtmf_recognition = Mock() - self.call_media_operations.stop_continuous_dtmf_recognition = mock_stop_continuous_dtmf_recognition - self.call_connection_client.stop_continuous_dtmf_recognition(target_participant=self.target_user) - - expected_continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( - target_participant=serialize_identifier(self.target_user)) - - mock_stop_continuous_dtmf_recognition.assert_called_once() - actual_call_connection_id = mock_stop_continuous_dtmf_recognition.call_args[0][0] - actual_stop_continuous_dtmf_recognition = mock_stop_continuous_dtmf_recognition.call_args[0][1] - - self.assertEqual(self.call_connection_id, actual_call_connection_id) - self.assertEqual(expected_continuous_dtmf_recognition_request.target_participant, - actual_stop_continuous_dtmf_recognition.target_participant) - self.assertEqual(expected_continuous_dtmf_recognition_request.operation_context, - actual_stop_continuous_dtmf_recognition.operation_context) - - def test_send_dtmf(self): - mock_send_dtmf = Mock() - self.call_media_operations.send_dtmf = mock_send_dtmf - self.call_connection_client.send_dtmf(tones=self.tones, - target_participant=self.target_user, - operation_context=self.operation_context) - - expected_send_dtmf_request = SendDtmfRequest( - tones=self.tones, - target_participant=serialize_identifier(self.target_user), - operation_context=self.operation_context) - - mock_send_dtmf.assert_called_once() - actual_call_connection_id = mock_send_dtmf.call_args[0][0] - actual_send_dtmf_request = mock_send_dtmf.call_args[0][1] - - self.assertEqual(self.call_connection_id, actual_call_connection_id) - self.assertEqual(expected_send_dtmf_request.target_participant, - actual_send_dtmf_request.target_participant) - self.assertEqual(expected_send_dtmf_request.tones, - actual_send_dtmf_request.tones) - self.assertEqual(expected_send_dtmf_request.operation_context, - actual_send_dtmf_request.operation_context) + self.assertEqual(self.call_connection_id, actual_call_connection_id) \ No newline at end of file From 5fa26a953b28e5eadb111e0c987d4d2032305a1d Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Thu, 25 May 2023 22:34:27 -0700 Subject: [PATCH 2/8] more GA updates --- .../callautomation/_api_versions.py | 4 +- .../callautomation/_call_automation_client.py | 19 +- .../callautomation/_call_connection_client.py | 54 +- .../callautomation/_generated/_client.py | 30 +- .../_generated/_configuration.py | 26 +- .../callautomation/_generated/aio/_client.py | 30 +- .../_generated/aio/_configuration.py | 26 +- .../_generated/aio/operations/_operations.py | 473 ++++++++++++++++-- .../_generated/models/_models.py | 60 +-- .../_generated/operations/_operations.py | 472 +++++++++++++++-- .../communication/callautomation/_models.py | 12 +- .../communication/callautomation/_utils.py | 4 +- .../aio/_call_automation_client_async.py | 7 +- .../aio/_call_connection_client_async.py | 42 +- .../swagger/SWAGGER.md | 4 +- ...all_automation_automated_live_test_base.py | 185 +++++++ ..._client_e2e.test_play_media_in_a_call.yaml | 284 +++++++++++ ...eate_VOIP_call_and_answer_then_hangup.yaml | 247 +++++++++ ...reate_VOIP_call_and_answer_then_hangup.txt | 4 + .../recordings/test_play_media_in_a_call.txt | 5 + .../tests/test_call_media_client.py | 24 +- .../tests/test_call_media_client_e2e.py | 126 +++++ .../tests/test_callautomation_client_e2e.py | 111 ++++ 23 files changed, 1966 insertions(+), 283 deletions(-) create mode 100644 sdk/communication/azure-communication-callautomation/tests/call_automation_automated_live_test_base.py create mode 100644 sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml create mode 100644 sdk/communication/azure-communication-callautomation/tests/recordings/test_callautomation_client_e2e.test_create_VOIP_call_and_answer_then_hangup.yaml create mode 100644 sdk/communication/azure-communication-callautomation/tests/recordings/test_create_VOIP_call_and_answer_then_hangup.txt create mode 100644 sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt create mode 100644 sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py create mode 100644 sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_api_versions.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_api_versions.py index 4ba690cb06f5..adf3a3c56b2c 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_api_versions.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_api_versions.py @@ -7,6 +7,6 @@ from azure.core import CaseInsensitiveEnumMeta class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - V2023_01_15_PREVIEW = "2023-01-15-preview" + V2023_03_06 = "2023-03-06" -DEFAULT_VERSION = ApiVersion.V2023_01_15_PREVIEW.value +DEFAULT_VERSION = ApiVersion.V2023_03_06.value diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py index a6ebd6953ac7..c853cc9e0d06 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py @@ -93,19 +93,14 @@ def __init__( parsed_url = urlparse(endpoint.rstrip('/')) if not parsed_url.netloc: raise ValueError(f"Invalid URL: {format(endpoint)}") - - # self._client = AzureCommunicationCallAutomationService( - # endpoint, - # api_version=api_version or DEFAULT_VERSION, - # authentication_policy=get_authentication_policy( - # endpoint, credential), - # sdk_moniker=SDK_MONIKER, - # **kwargs) self._client = AzureCommunicationCallAutomationService( endpoint, api_version=api_version or DEFAULT_VERSION, credential=credential, + authentication_policy=get_authentication_policy( + endpoint, credential), + sdk_moniker=SDK_MONIKER, **kwargs) self._call_recording_client = self._client.call_recording @@ -178,15 +173,13 @@ def create_call( source_caller_id_number=serialize_phone_identifier( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, - source_identity=serialize_communication_user_identifier( + source=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, ) result = self._client.create_call( create_call_request=create_call_request, - repeatability_first_sent=get_repeatability_timestamp(), - repeatability_request_id=get_repeatability_guid(), **kwargs) return CallConnectionProperties._from_generated(# pylint:disable=protected-access @@ -229,7 +222,7 @@ def create_group_call( source_caller_id_number=serialize_phone_identifier( source_caller_id_number) if source_caller_id_number else None, source_display_name=source_display_name, - source_identity=serialize_identifier( + source=serialize_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, ) @@ -269,7 +262,7 @@ def answer_call( answer_call_request = AnswerCallRequest( incoming_call_context=incoming_call_context, callback_uri=callback_url, - answered_by_identifier=serialize_communication_user_identifier( + answered_by=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context ) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py index 9a8221ee7a49..bbfd40f36f38 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py @@ -79,30 +79,30 @@ def __init__(# pylint: disable=missing-client-constructor-parameter-credential, api_version: Optional[str] = None, **kwargs ) -> None: - if not credential: - raise ValueError("credential can not be None") - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Host URL must be a string") - parsed_url = urlparse(endpoint.rstrip('/')) - if not parsed_url.netloc: - raise ValueError(f"Invalid URL: {format(endpoint)}") - # self._client = AzureCommunicationCallAutomationService( - # endpoint, - # api_version=api_version or DEFAULT_VERSION, - # authentication_policy=get_authentication_policy( - # endpoint, credential), - # sdk_moniker=SDK_MONIKER, - # **kwargs) - - self._client = AzureCommunicationCallAutomationService( - endpoint=endpoint, - credential=credential, - api_version=api_version or DEFAULT_VERSION, - **kwargs - ) + # check kwargs for call automation client. if null, check for credential otherwise dont. + call_automation_client = kwargs.get('_callautomation_client', None) + if call_automation_client is None: + if not credential: + raise ValueError("credential can not be None") + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Host URL must be a string") + parsed_url = urlparse(endpoint.rstrip('/')) + if not parsed_url.netloc: + raise ValueError(f"Invalid URL: {format(endpoint)}") + self._client = AzureCommunicationCallAutomationService( + endpoint=endpoint, + credential=credential, + api_version=api_version or DEFAULT_VERSION, + authentication_policy=get_authentication_policy( + endpoint, credential), + sdk_moniker=SDK_MONIKER, + **kwargs + ) + else: + self._client = call_automation_client self._call_connection_id = call_connection_id self._call_connection_client = self._client.call_connection @@ -300,7 +300,7 @@ def remove_participant( @distributed_trace def play_media( self, - play_source: 'FileSource', + play_source: List['FileSource'], play_to: List['CommunicationIdentifier'], *, loop: Optional[bool] = False, @@ -322,7 +322,7 @@ def play_media( :raises ~azure.core.exceptions.HttpResponseError: """ play_request = PlayRequest( - play_source_info=play_source._to_generated(),#pylint:disable=protected-access + play_sources=[source._to_generated() for source in play_source],#pylint:disable=protected-access play_to=[serialize_identifier(identifier) for identifier in play_to], play_options=PlayOptions(loop=loop), @@ -334,7 +334,7 @@ def play_media( @distributed_trace def play_media_to_all( self, - play_source: 'FileSource', + play_source: List['FileSource'], *, loop: Optional[bool] = False, operation_context: Optional[str] = None, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py index 96919fa20ed5..630a5e51e779 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py @@ -7,8 +7,7 @@ # -------------------------------------------------------------------------- from copy import deepcopy -import datetime -from typing import Any, Optional +from typing import Any from azure.core import PipelineClient from azure.core.credentials import AzureKeyCredential @@ -41,38 +40,15 @@ class AzureCommunicationCallAutomationService( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :param repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :type repeatability_request_id: str - :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :type repeatability_first_sent: ~datetime.datetime :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - endpoint: str, - credential: AzureKeyCredential, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: + def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: _endpoint = "{endpoint}" self._config = AzureCommunicationCallAutomationServiceConfiguration( - endpoint=endpoint, - credential=credential, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, - **kwargs + endpoint=endpoint, credential=credential, **kwargs ) self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py index 6637289ee4fa..e18c58689e0f 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_configuration.py @@ -6,8 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime -from typing import Any, Optional +from typing import Any from azure.core.configuration import Configuration from azure.core.credentials import AzureKeyCredential @@ -28,31 +27,12 @@ class AzureCommunicationCallAutomationServiceConfiguration( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :param repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :type repeatability_request_id: str - :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :type repeatability_first_sent: ~datetime.datetime :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - endpoint: str, - credential: AzureKeyCredential, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: + def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: super(AzureCommunicationCallAutomationServiceConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-03-06") @@ -63,8 +43,6 @@ def __init__( self.endpoint = endpoint self.credential = credential - self.repeatability_request_id = repeatability_request_id - self.repeatability_first_sent = repeatability_first_sent self.api_version = api_version kwargs.setdefault("sdk_moniker", "communication-callautomation/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py index d589322e714a..db1335f23db3 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py @@ -7,8 +7,7 @@ # -------------------------------------------------------------------------- from copy import deepcopy -import datetime -from typing import Any, Awaitable, Optional +from typing import Any, Awaitable from azure.core import AsyncPipelineClient from azure.core.credentials import AzureKeyCredential @@ -42,38 +41,15 @@ class AzureCommunicationCallAutomationService( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :param repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :type repeatability_request_id: str - :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :type repeatability_first_sent: ~datetime.datetime :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - endpoint: str, - credential: AzureKeyCredential, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: + def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: _endpoint = "{endpoint}" self._config = AzureCommunicationCallAutomationServiceConfiguration( - endpoint=endpoint, - credential=credential, - repeatability_request_id=repeatability_request_id, - repeatability_first_sent=repeatability_first_sent, - **kwargs + endpoint=endpoint, credential=credential, **kwargs ) self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py index eafe60f62c7f..25755c861934 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_configuration.py @@ -6,8 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime -from typing import Any, Optional +from typing import Any from azure.core.configuration import Configuration from azure.core.credentials import AzureKeyCredential @@ -28,31 +27,12 @@ class AzureCommunicationCallAutomationServiceConfiguration( :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :param repeatability_request_id: If specified, the client directs that the request is - repeatable; that is, that the client can make the request multiple times with the same - Repeatability-Request-Id and get back an appropriate response without the server executing the - request multiple times. The value of the Repeatability-Request-Id is an opaque string - representing a client-generated unique identifier for the request. It is a version 4 (random) - UUID. Default value is None. - :type repeatability_request_id: str - :param repeatability_first_sent: If Repeatability-Request-ID header is specified, then - Repeatability-First-Sent header must also be specified. The value should be the date and time - at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. - Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. - :type repeatability_first_sent: ~datetime.datetime :keyword api_version: Api Version. Default value is "2023-03-06". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - endpoint: str, - credential: AzureKeyCredential, - repeatability_request_id: Optional[str] = None, - repeatability_first_sent: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: + def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: super(AzureCommunicationCallAutomationServiceConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-03-06") @@ -63,8 +43,6 @@ def __init__( self.endpoint = endpoint self.credential = credential - self.repeatability_request_id = repeatability_request_id - self.repeatability_first_sent = repeatability_first_sent self.api_version = api_version kwargs.setdefault("sdk_moniker", "communication-callautomation/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py index 55645f953ba7..e5cdfbcb0fc2 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -58,7 +59,13 @@ class AzureCommunicationCallAutomationServiceOperationsMixin(AzureCommunicationCallAutomationServiceMixinABC): @overload async def create_call( - self, create_call_request: _models.CreateCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + create_call_request: _models.CreateCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -66,6 +73,18 @@ async def create_call( :param create_call_request: The create call request. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -76,7 +95,13 @@ async def create_call( @overload async def create_call( - self, create_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + create_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -84,6 +109,18 @@ async def create_call( :param create_call_request: The create call request. Required. :type create_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94,7 +131,12 @@ async def create_call( @distributed_trace_async async def create_call( - self, create_call_request: Union[_models.CreateCallRequest, IO], **kwargs: Any + self, + create_call_request: Union[_models.CreateCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -103,6 +145,18 @@ async def create_call( :param create_call_request: The create call request. Is either a CreateCallRequest type or a IO type. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -133,8 +187,8 @@ async def create_call( _json = self._serialize.body(create_call_request, "CreateCallRequest") request = build_azure_communication_call_automation_service_create_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -168,7 +222,13 @@ async def create_call( @overload async def answer_call( - self, answer_call_request: _models.AnswerCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + answer_call_request: _models.AnswerCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -176,6 +236,18 @@ async def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -186,7 +258,13 @@ async def answer_call( @overload async def answer_call( - self, answer_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + answer_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -194,6 +272,18 @@ async def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -204,7 +294,12 @@ async def answer_call( @distributed_trace_async async def answer_call( - self, answer_call_request: Union[_models.AnswerCallRequest, IO], **kwargs: Any + self, + answer_call_request: Union[_models.AnswerCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -213,6 +308,18 @@ async def answer_call( :param answer_call_request: The answer call request. Is either a AnswerCallRequest type or a IO type. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -243,8 +350,8 @@ async def answer_call( _json = self._serialize.body(answer_call_request, "AnswerCallRequest") request = build_azure_communication_call_automation_service_answer_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -281,6 +388,8 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements self, redirect_call_request: _models.RedirectCallRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> None: @@ -290,6 +399,18 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -300,7 +421,13 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @overload async def redirect_call( # pylint: disable=inconsistent-return-statements - self, redirect_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + redirect_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Redirect a call. @@ -308,6 +435,18 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -318,7 +457,12 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def redirect_call( # pylint: disable=inconsistent-return-statements - self, redirect_call_request: Union[_models.RedirectCallRequest, IO], **kwargs: Any + self, + redirect_call_request: Union[_models.RedirectCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Redirect a call. @@ -328,6 +472,18 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements or a IO type. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -358,8 +514,8 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(redirect_call_request, "RedirectCallRequest") request = build_azure_communication_call_automation_service_redirect_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -389,7 +545,13 @@ async def redirect_call( # pylint: disable=inconsistent-return-statements @overload async def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: _models.RejectCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + reject_call_request: _models.RejectCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Reject the call. @@ -397,6 +559,18 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -407,7 +581,13 @@ async def reject_call( # pylint: disable=inconsistent-return-statements @overload async def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + reject_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Reject the call. @@ -415,6 +595,18 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -425,7 +617,12 @@ async def reject_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: Union[_models.RejectCallRequest, IO], **kwargs: Any + self, + reject_call_request: Union[_models.RejectCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Reject the call. @@ -434,6 +631,18 @@ async def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Is either a RejectCallRequest type or a IO type. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -464,8 +673,8 @@ async def reject_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(reject_call_request, "RejectCallRequest") request = build_azure_communication_call_automation_service_reject_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -625,7 +834,12 @@ async def hangup_call( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def terminate_call( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, **kwargs: Any + self, + call_connection_id: str, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Terminate a call using CallConnectionId. @@ -633,6 +847,18 @@ async def terminate_call( # pylint: disable=inconsistent-return-statements :param call_connection_id: The terminate call request. Required. :type call_connection_id: str + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -652,8 +878,8 @@ async def terminate_call( # pylint: disable=inconsistent-return-statements request = build_call_connection_terminate_call_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, api_version=self._config.api_version, headers=_headers, params=_params, @@ -684,6 +910,8 @@ async def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: _models.TransferToParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -696,6 +924,18 @@ async def transfer_to_participant( :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -710,6 +950,8 @@ async def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -721,6 +963,18 @@ async def transfer_to_participant( :type call_connection_id: str :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -734,6 +988,9 @@ async def transfer_to_participant( self, call_connection_id: str, transfer_to_participant_request: Union[_models.TransferToParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> _models.TransferCallResponse: """Transfer the call to a participant. @@ -746,6 +1003,18 @@ async def transfer_to_participant( TransferToParticipantRequest type or a IO type. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -777,8 +1046,8 @@ async def transfer_to_participant( request = build_call_connection_transfer_to_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -909,6 +1178,8 @@ async def add_participant( call_connection_id: str, add_participant_request: _models.AddParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: @@ -920,6 +1191,18 @@ async def add_participant( :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -934,6 +1217,8 @@ async def add_participant( call_connection_id: str, add_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: @@ -945,6 +1230,18 @@ async def add_participant( :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -955,7 +1252,13 @@ async def add_participant( @distributed_trace_async async def add_participant( - self, call_connection_id: str, add_participant_request: Union[_models.AddParticipantRequest, IO], **kwargs: Any + self, + call_connection_id: str, + add_participant_request: Union[_models.AddParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.AddParticipantResponse: """Add a participant to the call. @@ -966,6 +1269,18 @@ async def add_participant( :param add_participant_request: Is either a AddParticipantRequest type or a IO type. Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -997,8 +1312,8 @@ async def add_participant( request = build_call_connection_add_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1036,6 +1351,8 @@ async def remove_participant( call_connection_id: str, remove_participant_request: _models.RemoveParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: @@ -1048,6 +1365,18 @@ async def remove_participant( :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1062,6 +1391,8 @@ async def remove_participant( call_connection_id: str, remove_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: @@ -1073,6 +1404,18 @@ async def remove_participant( :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1086,6 +1429,9 @@ async def remove_participant( self, call_connection_id: str, remove_participant_request: Union[_models.RemoveParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> _models.RemoveParticipantResponse: """Remove a participant from the call using identifier. @@ -1098,6 +1444,18 @@ async def remove_participant( RemoveParticipantRequest type or a IO type. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1129,8 +1487,8 @@ async def remove_participant( request = build_call_connection_remove_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1551,6 +1909,8 @@ async def start_recording( self, start_call_recording: _models.StartCallRecordingRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: @@ -1561,6 +1921,18 @@ async def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1571,7 +1943,13 @@ async def start_recording( @overload async def start_recording( - self, start_call_recording: IO, *, content_type: str = "application/json", **kwargs: Any + self, + start_call_recording: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -1579,6 +1957,18 @@ async def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1589,7 +1979,12 @@ async def start_recording( @distributed_trace_async async def start_recording( - self, start_call_recording: Union[_models.StartCallRecordingRequest, IO], **kwargs: Any + self, + start_call_recording: Union[_models.StartCallRecordingRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -1599,6 +1994,18 @@ async def start_recording( StartCallRecordingRequest type or a IO type. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1629,8 +2036,8 @@ async def start_recording( _json = self._serialize.body(start_call_recording, "StartCallRecordingRequest") request = build_call_recording_start_recording_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py index da6374a579e9..1e5707cba45c 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/models/_models.py @@ -1430,8 +1430,8 @@ class PlayRequest(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar play_source_info: The source of the audio to be played. Required. - :vartype play_source_info: ~azure.communication.callautomation.models.PlaySource + :ivar play_sources: The source of the audio to be played. Required. + :vartype play_sources: list[~azure.communication.callautomation.models.PlaySource] :ivar play_to: The list of call participants play provided audio to. Plays to everyone in the call when not provided. :vartype play_to: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] @@ -1442,11 +1442,11 @@ class PlayRequest(_serialization.Model): """ _validation = { - "play_source_info": {"required": True}, + "play_sources": {"required": True}, } _attribute_map = { - "play_source_info": {"key": "playSourceInfo", "type": "PlaySource"}, + "play_sources": {"key": "playSources", "type": "[PlaySource]"}, "play_to": {"key": "playTo", "type": "[CommunicationIdentifierModel]"}, "play_options": {"key": "playOptions", "type": "PlayOptions"}, "operation_context": {"key": "operationContext", "type": "str"}, @@ -1455,15 +1455,15 @@ class PlayRequest(_serialization.Model): def __init__( self, *, - play_source_info: "_models.PlaySource", + play_sources: List["_models.PlaySource"], play_to: Optional[List["_models.CommunicationIdentifierModel"]] = None, play_options: Optional["_models.PlayOptions"] = None, operation_context: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword play_source_info: The source of the audio to be played. Required. - :paramtype play_source_info: ~azure.communication.callautomation.models.PlaySource + :keyword play_sources: The source of the audio to be played. Required. + :paramtype play_sources: list[~azure.communication.callautomation.models.PlaySource] :keyword play_to: The list of call participants play provided audio to. Plays to everyone in the call when not provided. :paramtype play_to: @@ -1474,7 +1474,7 @@ def __init__( :paramtype operation_context: str """ super().__init__(**kwargs) - self.play_source_info = play_source_info + self.play_sources = play_sources self.play_to = play_to self.play_options = play_options self.operation_context = operation_context @@ -1485,44 +1485,44 @@ class PlaySource(_serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar source_type: Defines the type of the play source. Required. "file" - :vartype source_type: str or ~azure.communication.callautomation.models.PlaySourceType - :ivar play_source_id: Defines the identifier to be used for caching related media. - :vartype play_source_id: str - :ivar file_source: Defines the file source info to be used for play. - :vartype file_source: ~azure.communication.callautomation.models.FileSource + :ivar kind: Defines the type of the play source. Required. "file" + :vartype kind: str or ~azure.communication.callautomation.models.PlaySourceType + :ivar play_source_cache_id: Defines the identifier to be used for caching related media. + :vartype play_source_cache_id: str + :ivar file: Defines the file source info to be used for play. + :vartype file: ~azure.communication.callautomation.models.FileSource """ _validation = { - "source_type": {"required": True}, + "kind": {"required": True}, } _attribute_map = { - "source_type": {"key": "sourceType", "type": "str"}, - "play_source_id": {"key": "playSourceId", "type": "str"}, - "file_source": {"key": "fileSource", "type": "FileSource"}, + "kind": {"key": "kind", "type": "str"}, + "play_source_cache_id": {"key": "playSourceCacheId", "type": "str"}, + "file": {"key": "file", "type": "FileSource"}, } def __init__( self, *, - source_type: Union[str, "_models.PlaySourceType"], - play_source_id: Optional[str] = None, - file_source: Optional["_models.FileSource"] = None, + kind: Union[str, "_models.PlaySourceType"], + play_source_cache_id: Optional[str] = None, + file: Optional["_models.FileSource"] = None, **kwargs: Any ) -> None: """ - :keyword source_type: Defines the type of the play source. Required. "file" - :paramtype source_type: str or ~azure.communication.callautomation.models.PlaySourceType - :keyword play_source_id: Defines the identifier to be used for caching related media. - :paramtype play_source_id: str - :keyword file_source: Defines the file source info to be used for play. - :paramtype file_source: ~azure.communication.callautomation.models.FileSource + :keyword kind: Defines the type of the play source. Required. "file" + :paramtype kind: str or ~azure.communication.callautomation.models.PlaySourceType + :keyword play_source_cache_id: Defines the identifier to be used for caching related media. + :paramtype play_source_cache_id: str + :keyword file: Defines the file source info to be used for play. + :paramtype file: ~azure.communication.callautomation.models.FileSource """ super().__init__(**kwargs) - self.source_type = source_type - self.play_source_id = play_source_id - self.file_source = file_source + self.kind = kind + self.play_source_cache_id = play_source_cache_id + self.file = file class RecognizeCanceled(_serialization.Model): diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py index 311cccabb143..99da6e0594d7 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/operations/_operations.py @@ -649,7 +649,13 @@ def build_call_recording_resume_recording_request(recording_id: str, **kwargs: A class AzureCommunicationCallAutomationServiceOperationsMixin(AzureCommunicationCallAutomationServiceMixinABC): @overload def create_call( - self, create_call_request: _models.CreateCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + create_call_request: _models.CreateCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -657,6 +663,18 @@ def create_call( :param create_call_request: The create call request. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -667,7 +685,13 @@ def create_call( @overload def create_call( - self, create_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + create_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -675,6 +699,18 @@ def create_call( :param create_call_request: The create call request. Required. :type create_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -685,7 +721,12 @@ def create_call( @distributed_trace def create_call( - self, create_call_request: Union[_models.CreateCallRequest, IO], **kwargs: Any + self, + create_call_request: Union[_models.CreateCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.CallConnectionProperties: """Create an outbound call. @@ -694,6 +735,18 @@ def create_call( :param create_call_request: The create call request. Is either a CreateCallRequest type or a IO type. Required. :type create_call_request: ~azure.communication.callautomation.models.CreateCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -724,8 +777,8 @@ def create_call( _json = self._serialize.body(create_call_request, "CreateCallRequest") request = build_azure_communication_call_automation_service_create_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -759,7 +812,13 @@ def create_call( @overload def answer_call( - self, answer_call_request: _models.AnswerCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + answer_call_request: _models.AnswerCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -767,6 +826,18 @@ def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -777,7 +848,13 @@ def answer_call( @overload def answer_call( - self, answer_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + answer_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -785,6 +862,18 @@ def answer_call( :param answer_call_request: The answer call request. Required. :type answer_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -795,7 +884,12 @@ def answer_call( @distributed_trace def answer_call( - self, answer_call_request: Union[_models.AnswerCallRequest, IO], **kwargs: Any + self, + answer_call_request: Union[_models.AnswerCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.CallConnectionProperties: """Answer a Call. @@ -804,6 +898,18 @@ def answer_call( :param answer_call_request: The answer call request. Is either a AnswerCallRequest type or a IO type. Required. :type answer_call_request: ~azure.communication.callautomation.models.AnswerCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -834,8 +940,8 @@ def answer_call( _json = self._serialize.body(answer_call_request, "AnswerCallRequest") request = build_azure_communication_call_automation_service_answer_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -872,6 +978,8 @@ def redirect_call( # pylint: disable=inconsistent-return-statements self, redirect_call_request: _models.RedirectCallRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> None: @@ -881,6 +989,18 @@ def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -891,7 +1011,13 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @overload def redirect_call( # pylint: disable=inconsistent-return-statements - self, redirect_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + redirect_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Redirect a call. @@ -899,6 +1025,18 @@ def redirect_call( # pylint: disable=inconsistent-return-statements :param redirect_call_request: The redirect call request. Required. :type redirect_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -909,7 +1047,12 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @distributed_trace def redirect_call( # pylint: disable=inconsistent-return-statements - self, redirect_call_request: Union[_models.RedirectCallRequest, IO], **kwargs: Any + self, + redirect_call_request: Union[_models.RedirectCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Redirect a call. @@ -919,6 +1062,18 @@ def redirect_call( # pylint: disable=inconsistent-return-statements or a IO type. Required. :type redirect_call_request: ~azure.communication.callautomation.models.RedirectCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -949,8 +1104,8 @@ def redirect_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(redirect_call_request, "RedirectCallRequest") request = build_azure_communication_call_automation_service_redirect_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -980,7 +1135,13 @@ def redirect_call( # pylint: disable=inconsistent-return-statements @overload def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: _models.RejectCallRequest, *, content_type: str = "application/json", **kwargs: Any + self, + reject_call_request: _models.RejectCallRequest, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Reject the call. @@ -988,6 +1149,18 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -998,7 +1171,13 @@ def reject_call( # pylint: disable=inconsistent-return-statements @overload def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: IO, *, content_type: str = "application/json", **kwargs: Any + self, + reject_call_request: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> None: """Reject the call. @@ -1006,6 +1185,18 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Required. :type reject_call_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1016,7 +1207,12 @@ def reject_call( # pylint: disable=inconsistent-return-statements @distributed_trace def reject_call( # pylint: disable=inconsistent-return-statements - self, reject_call_request: Union[_models.RejectCallRequest, IO], **kwargs: Any + self, + reject_call_request: Union[_models.RejectCallRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Reject the call. @@ -1025,6 +1221,18 @@ def reject_call( # pylint: disable=inconsistent-return-statements :param reject_call_request: The reject call request. Is either a RejectCallRequest type or a IO type. Required. :type reject_call_request: ~azure.communication.callautomation.models.RejectCallRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1055,8 +1263,8 @@ def reject_call( # pylint: disable=inconsistent-return-statements _json = self._serialize.body(reject_call_request, "RejectCallRequest") request = build_azure_communication_call_automation_service_reject_call_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1216,7 +1424,12 @@ def hangup_call( # pylint: disable=inconsistent-return-statements @distributed_trace def terminate_call( # pylint: disable=inconsistent-return-statements - self, call_connection_id: str, **kwargs: Any + self, + call_connection_id: str, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """Terminate a call using CallConnectionId. @@ -1224,6 +1437,18 @@ def terminate_call( # pylint: disable=inconsistent-return-statements :param call_connection_id: The terminate call request. Required. :type call_connection_id: str + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1243,8 +1468,8 @@ def terminate_call( # pylint: disable=inconsistent-return-statements request = build_call_connection_terminate_call_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1275,6 +1500,8 @@ def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: _models.TransferToParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -1287,6 +1514,18 @@ def transfer_to_participant( :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1301,6 +1540,8 @@ def transfer_to_participant( call_connection_id: str, transfer_to_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.TransferCallResponse: @@ -1312,6 +1553,18 @@ def transfer_to_participant( :type call_connection_id: str :param transfer_to_participant_request: The transfer to participant request. Required. :type transfer_to_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1325,6 +1578,9 @@ def transfer_to_participant( self, call_connection_id: str, transfer_to_participant_request: Union[_models.TransferToParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> _models.TransferCallResponse: """Transfer the call to a participant. @@ -1337,6 +1593,18 @@ def transfer_to_participant( TransferToParticipantRequest type or a IO type. Required. :type transfer_to_participant_request: ~azure.communication.callautomation.models.TransferToParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1368,8 +1636,8 @@ def transfer_to_participant( request = build_call_connection_transfer_to_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1500,6 +1768,8 @@ def add_participant( call_connection_id: str, add_participant_request: _models.AddParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: @@ -1511,6 +1781,18 @@ def add_participant( :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1525,6 +1807,8 @@ def add_participant( call_connection_id: str, add_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.AddParticipantResponse: @@ -1536,6 +1820,18 @@ def add_participant( :type call_connection_id: str :param add_participant_request: Required. :type add_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1546,7 +1842,13 @@ def add_participant( @distributed_trace def add_participant( - self, call_connection_id: str, add_participant_request: Union[_models.AddParticipantRequest, IO], **kwargs: Any + self, + call_connection_id: str, + add_participant_request: Union[_models.AddParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.AddParticipantResponse: """Add a participant to the call. @@ -1557,6 +1859,18 @@ def add_participant( :param add_participant_request: Is either a AddParticipantRequest type or a IO type. Required. :type add_participant_request: ~azure.communication.callautomation.models.AddParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1588,8 +1902,8 @@ def add_participant( request = build_call_connection_add_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -1627,6 +1941,8 @@ def remove_participant( call_connection_id: str, remove_participant_request: _models.RemoveParticipantRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: @@ -1639,6 +1955,18 @@ def remove_participant( :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1653,6 +1981,8 @@ def remove_participant( call_connection_id: str, remove_participant_request: IO, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RemoveParticipantResponse: @@ -1664,6 +1994,18 @@ def remove_participant( :type call_connection_id: str :param remove_participant_request: The participant to be removed from the call. Required. :type remove_participant_request: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1677,6 +2019,9 @@ def remove_participant( self, call_connection_id: str, remove_participant_request: Union[_models.RemoveParticipantRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, **kwargs: Any ) -> _models.RemoveParticipantResponse: """Remove a participant from the call using identifier. @@ -1689,6 +2034,18 @@ def remove_participant( RemoveParticipantRequest type or a IO type. Required. :type remove_participant_request: ~azure.communication.callautomation.models.RemoveParticipantRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -1720,8 +2077,8 @@ def remove_participant( request = build_call_connection_remove_participant_request( call_connection_id=call_connection_id, - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, @@ -2142,6 +2499,8 @@ def start_recording( self, start_call_recording: _models.StartCallRecordingRequest, *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RecordingStateResponse: @@ -2152,6 +2511,18 @@ def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2162,7 +2533,13 @@ def start_recording( @overload def start_recording( - self, start_call_recording: IO, *, content_type: str = "application/json", **kwargs: Any + self, + start_call_recording: IO, + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -2170,6 +2547,18 @@ def start_recording( :param start_call_recording: The request body of start call recording request. Required. :type start_call_recording: IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2180,7 +2569,12 @@ def start_recording( @distributed_trace def start_recording( - self, start_call_recording: Union[_models.StartCallRecordingRequest, IO], **kwargs: Any + self, + start_call_recording: Union[_models.StartCallRecordingRequest, IO], + *, + repeatability_request_id: Optional[str] = None, + repeatability_first_sent: Optional[datetime.datetime] = None, + **kwargs: Any ) -> _models.RecordingStateResponse: """Start recording the call. @@ -2190,6 +2584,18 @@ def start_recording( StartCallRecordingRequest type or a IO type. Required. :type start_call_recording: ~azure.communication.callautomation.models.StartCallRecordingRequest or IO + :keyword repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-Id and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-Id is an opaque string + representing a client-generated unique identifier for the request. It is a version 4 (random) + UUID. Default value is None. + :paramtype repeatability_request_id: str + :keyword repeatability_first_sent: If Repeatability-Request-ID header is specified, then + Repeatability-First-Sent header must also be specified. The value should be the date and time + at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. + Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None. + :paramtype repeatability_first_sent: ~datetime.datetime :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str @@ -2220,8 +2626,8 @@ def start_recording( _json = self._serialize.body(start_call_recording, "StartCallRecordingRequest") request = build_call_recording_start_recording_request( - repeatability_request_id=self._config.repeatability_request_id, - repeatability_first_sent=self._config.repeatability_first_sent, + repeatability_request_id=repeatability_request_id, + repeatability_first_sent=repeatability_first_sent, content_type=content_type, api_version=self._config.api_version, json=_json, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py index 50e07f1a7aa3..e03ada47c131 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py @@ -167,7 +167,7 @@ def __init__( self, url: str, *, - play_source_id: Optional[str] = None, + play_source_cache_id: Optional[str] = None, **kwargs ): """Media file source of URL to be played in action such as Play media. @@ -179,14 +179,14 @@ def __init__( """ super().__init__(**kwargs) self.url = url - self.play_source_id = play_source_id + self.play_source_cache_id = play_source_cache_id def _to_generated(self): return PlaySourceInternal( - source_type=PlaySourceType.FILE, - file_source=FileSourceInternal(uri=self.url), - play_source_id=self.play_source_id - ) + kind=PlaySourceType.FILE, + play_source_cache_id=self.play_source_cache_id, + file=FileSourceInternal(uri=self.url) + ) class CallConnectionProperties(): # type: ignore # pylint: disable=too-many-instance-attributes """ Detailed properties of the call. diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_utils.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_utils.py index 2ef81bcfc622..67e13338dc80 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_utils.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_utils.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- from typing import Dict, Any, Union import uuid -from datetime import datetime +from datetime import datetime, timezone from ._shared.models import ( CommunicationIdentifier, CommunicationUserIdentifier, @@ -24,7 +24,7 @@ def get_repeatability_guid(): return uuid.uuid4() def get_repeatability_timestamp(): - return datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT') + return datetime.now(timezone.utc) def serialize_identifier( identifier:CommunicationIdentifier diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py index 0b193e785b2d..cbc4e3c0ac8f 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py @@ -100,6 +100,7 @@ def __init__( self._client = AzureCommunicationCallAutomationService( endpoint, api_version=api_version or DEFAULT_VERSION, + credential=credential, authentication_policy=get_authentication_policy( endpoint, credential, is_async=True), sdk_moniker=SDK_MONIKER, @@ -175,7 +176,7 @@ async def create_call( source_caller_id_number=serialize_phone_identifier( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, - source_identity=serialize_communication_user_identifier( + source=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, ) @@ -225,7 +226,7 @@ async def create_group_call( source_caller_id_number=serialize_phone_identifier( source_caller_id_number) if source_caller_id_number else None, source_display_name=source_display_name, - source_identity=serialize_identifier( + source=serialize_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context, ) @@ -264,7 +265,7 @@ async def answer_call( answer_call_request = AnswerCallRequest( incoming_call_context=incoming_call_context, callback_uri=callback_url, - answered_by_identifier=serialize_communication_user_identifier( + answered_by=serialize_communication_user_identifier( self.source_identity) if self.source_identity else None, operation_context=operation_context ) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py index 7451b04f5a2d..f7ee8afa451d 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py @@ -82,23 +82,29 @@ def __init__(# pylint: disable=missing-client-constructor-parameter-credential, api_version: Optional[str] = None, **kwargs ) -> None: - if not credential: - raise ValueError("credential can not be None") - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Host URL must be a string") - parsed_url = urlparse(endpoint.rstrip('/')) - if not parsed_url.netloc: - raise ValueError(f"Invalid URL: {format(endpoint)}") - self._client = AzureCommunicationCallAutomationService( - endpoint, - api_version=api_version or DEFAULT_VERSION, - authentication_policy=get_authentication_policy( - endpoint, credential, is_async=True), - sdk_moniker=SDK_MONIKER, - **kwargs) + call_automation_client = kwargs.get('_callautomation_client', None) + if call_automation_client is None: + if not credential: + raise ValueError("credential can not be None") + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Host URL must be a string") + parsed_url = urlparse(endpoint.rstrip('/')) + if not parsed_url.netloc: + raise ValueError(f"Invalid URL: {format(endpoint)}") + self._client = AzureCommunicationCallAutomationService( + endpoint, + api_version=api_version or DEFAULT_VERSION, + credential=credential, + authentication_policy=get_authentication_policy( + endpoint, credential, is_async=True), + sdk_moniker=SDK_MONIKER, + **kwargs) + else: + self._client = call_automation_client + self._call_connection_id = call_connection_id self._call_connection_client = self._client.call_connection self._call_media_client = self._client.call_media @@ -320,7 +326,7 @@ async def play_media( :raises ~azure.core.exceptions.HttpResponseError: """ play_request = PlayRequest( - play_source_info=play_source._to_generated(),#pylint:disable=protected-access + play_sources=[source._to_generated() for source in play_source],#pylint:disable=protected-access play_to=[serialize_identifier(identifier) for identifier in play_to], play_options=PlayOptions(loop=loop), diff --git a/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md b/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md index 943cde9a2f0e..abf499a0662f 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md +++ b/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md @@ -16,8 +16,8 @@ autorest SWAGGER.md ### Settings ```yaml -tag: package-2023-01-15-preview -require: https://github.com/williamzhao87/azure-rest-api-specs/blob/885b18fa094fbb953b1a0cb77c52536a8d745be5/specification/communication/data-plane/CallAutomation/readme.md +tag: package-2023-03-06 +require: https://github.com/Azure/azure-rest-api-specs/blob/e669e3594775698f825dad6e0a47972adc0cbf70/specification/communication/data-plane/CallAutomation/readme.md output-folder: ../azure/communication/callautomation/_generated models-mode: msrest namespace: azure.communication.callautomation diff --git a/sdk/communication/azure-communication-callautomation/tests/call_automation_automated_live_test_base.py b/sdk/communication/azure-communication-callautomation/tests/call_automation_automated_live_test_base.py new file mode 100644 index 000000000000..956f3298298a --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/call_automation_automated_live_test_base.py @@ -0,0 +1,185 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import os +import json +import time +from datetime import datetime +from typing import Any, Dict, List + +import requests +from azure.servicebus import ServiceBusClient +from devtools_testutils import is_live + +from _shared.asynctestcase import AsyncCommunicationTestCase + + +class CallAutomationAutomatedLiveTestBase(AsyncCommunicationTestCase): + def __init__(self, method_name, *args, **kwargs): + self.servicebus_connection_str = os.environ.get('SERVICEBUS_STRING', 'Endpoint=REDACTED=') + self.dispatcher_endpoint = os.environ.get('DISPATCHER_ENDPOINT', 'https://REDACTED.azurewebsites.net') + self.dispatcher_callback = self.dispatcher_endpoint + '/api/servicebuscallback/events' + self.processor_store: Dict[str, Any] = {} + self.incoming_call_context_store: Dict[str, Any] = {} + self.event_store: Dict[str, Dict[str, Any]] = {} + self.events_to_persist: List[str] = [] + super(CallAutomationAutomatedLiveTestBase, self).__init__(method_name, *args, **kwargs) + + def _format_string(self, s) -> str: + s1 = f"{s[:12]}-{s[12:16]}-{s[16:20]}-{s[20:24]}-{s[24:36]}" + s2 = f"{s[36:44]}-{s[44:48]}-{s[48:52]}-{s[52:56]}-{s[56:]}" + return f"{s1}_{s2}" + + def _parse_ids_from_identifier(self, identifier: str) -> str: + if identifier is None: + raise ValueError("Identifier cannot be None") + return self._format_string(''.join(filter(str.isalnum, identifier))) + + def _message_handler(self, message: Any) -> bool: + if not message: + raise ValueError("Body cannot be empty") + + self.events_to_persist.append(message) + mapper = json.loads(message) + + if "incomingCallContext" in mapper: + incoming_call_context = mapper["incomingCallContext"] + from_id = mapper["from"]["rawId"] + to_id = mapper["to"]["rawId"] + unique_id = self._parse_ids_from_identifier(from_id) + self._parse_ids_from_identifier(to_id) + self.incoming_call_context_store[unique_id] = incoming_call_context + return True + else: + if isinstance(mapper, list): + mapper = mapper[0] + if mapper["type"]: + print('MAPPER: ' + mapper["type"]) + self.event_store[mapper["data"]["callConnectionId"]] = mapper["type"].split(".")[-1] + return False + + def service_bus_with_new_call(self, caller, receiver) -> str: + """Create new ServiceBus client. + Creates a new queue in the ServiceBus and a client in order to interact with it. + + :param caller: User initiating the call. + :type caller: CommunicationUserIdentifier + :param receiver: User receiving the call. + :type receiver: CommunicationUserIdentifier + + :return: a unique_id that can be used to identify the ServiceBus queue. + :rtype: str + """ + unique_id = self._parse_ids_from_identifier(caller.raw_id) + self._parse_ids_from_identifier(receiver.raw_id) + if is_live(): + dispatcher_url = f"{self.dispatcher_endpoint}/api/servicebuscallback/subscribe?q={unique_id}" + response = requests.post(dispatcher_url) + + if response is None: + raise ValueError("Response cannot be None") + + print(f"Subscription to dispatcher of {unique_id}: {response.status_code}") + service_bus_client = ServiceBusClient.from_connection_string(self.servicebus_connection_str) + self.processor_store[unique_id] = service_bus_client + return unique_id + + def wait_for_messages(self, unique_id, time_out) -> None: + """Wait for messages. + Checks the Service Bus queue specified by the unique_id for messages and stores them in the event_store. + + :param unique_id: Identifier used to keep track of ServiceBus message queue. + :type unique_id: str + :param time_out: How long to wait for a response. + :type time_out: timedelta + + :return: None + :rtype: None + """ + if is_live(): + service_bus_receiver = self.processor_store[unique_id].get_queue_receiver(queue_name=unique_id) + time_out_time = datetime.now() + time_out + + while datetime.now() < time_out_time: + received_messages = service_bus_receiver.receive_messages(max_wait_time=20) + for msg in received_messages: + print(msg) + body = msg.body + body_bytes = b''.join(body) + body_str = body_bytes.decode('utf-8') + is_incoming_call_event = self._message_handler(body_str) + service_bus_receiver.complete_message(msg) + if is_incoming_call_event: + return + if not received_messages: + time.sleep(1) + + def check_for_event(self, event_type: str, call_connection_id: str) -> bool: + """Check for events. + Checks the event_store for any events that have been received from the Service Bus queue with the specified event_type and call_connection_id. + + :param event_type: Type of event to check for in the event store. + :type event_type: Type + :param call_connection_id: The call_connection_id for which to find events for. + :type call_connection_id: str + + :return: None if no events are found. The event object if an event is found. + :rtype: Optional[Any] + """ + if self.event_store[call_connection_id] == event_type: + return True + return False + + def load_persisted_events(self, test_name) -> None: + """ + Load persisted events. + + If the test is running in playback mode, this function opens the .txt file located in the recordings directory and loads the events into the event_store. + + :param test_name: The name of the test currently running. + :type test_name: str + + :return: None + :rtype: None + """ + if not is_live(): + data = '' + script_dir = os.path.dirname(os.path.realpath(__file__)) + file_path = os.path.join(script_dir, 'recordings', f'{test_name}.txt') + try: + with open(file_path, 'r') as file: + data = file.read() + except FileNotFoundError: + print(f"File '{file_path}' does not exist.") + data = '' + event_strings = data.split("\n") + for event in event_strings: + self._message_handler(event) + + def persist_events(self, test_name) -> None: + """ + Persist events. + + If the test is running in record mode, this function creates a .txt file and writes the events to it. + + :param test_name: The name of the test currently running to be used as the file name. + :type test_name: str + + :return: None + :rtype: None + """ + if is_live(): + script_dir = os.path.dirname(os.path.realpath(__file__)) + file_path = os.path.join(script_dir, 'recordings', f'{test_name}.txt') + try: + with open(file_path, 'w') as file: + file.write('\n'.join(self.events_to_persist)) + except IOError as e: + raise SystemExit(f"File write operation failed: {e}") + + # clear list for next test to use + self.events_to_persist.clear() + + def cleanup(self) -> None: + for _, receiver in self.processor_store.items(): + receiver.close() \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml b/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml new file mode 100644 index 000000000000..ca05c4b3adc7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml @@ -0,0 +1,284 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:03:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 + response: + body: + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, + 2021-11-01, 2022-06-01, 2022-10-01, 2023-08-01 + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:03:20 GMT + ms-cv: + - iEQZjcEcEU2bNNySjJURAw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 20ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:03:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 + response: + body: + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, + 2021-11-01, 2022-06-01, 2022-10-01, 2023-08-01 + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:03:20 GMT + ms-cv: + - gZMXExE7j0a8/ySSaXa9Xg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 34ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.28.2 + method: POST + uri: https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/subscribe?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 26 May 2023 01:03:22 GMT + server: + - Kestrel + status: + code: 200 + message: OK +- request: + body: '{"targets": [{"rawId": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94", + "communicationUser": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}], + "source": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}, + "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '574' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:03:22 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections?api-version=2023-03-06 + response: + body: + string: '{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}],"callConnectionState":"connecting","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"correlationId":"2cf9712f-c610-4279-8784-cb5984849859"}' + headers: + content-length: + - '901' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:03:23 GMT + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - 2cf9712f-c610-4279-8784-cb5984849859 + status: + code: 201 + message: Created +- request: + body: '{"incomingCallContext": "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjYyI6Ikg0c0lBQUFBQUFBQUNzMVlhMi9iT0JiOUs0SVhtQStMMGlJcFNxSUlHQXZiU1JwUEptbWUzZDBnMklDaUtKdU5Ya1BKajdUVC96Nlh0cE80ZFhiYTNaMVpqQk1vSm5sNXpybFhmTnliVHowbGkrS3M3a3h1bE94TVhmWEVwMTV1NjlMOU5WbFA5TGlRcWhVa3phU2thWUtTRU1lSWhZeWlOSTBZa25GS3FjSlk4b3pkNC9XSGNKU0hjWVE0eXltaWlrdUVPZU9VWWh4RkhQZmU5RExUTm9WOFBKT2xCbnpvMEZYVzFLYnFKbzZQeHBoTEhHbVVad2t3Y1JvQ0V0WklNcVpwVHFRbVVRUnpD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kQ3TWpZWnlBRmFhM051Q3Jhb2dERFN4YkRreVVaNHcxYjlrdHV6dGx6ZUhNTF9HNjd0cVBiemVWT3drdll6LVNmVjlzX1Ryekd6dHJEQ2xBdnBVZU1Ba3ptNjFPLW94ZS1Qa1BFZFVoSlhzTEU3RGQ4ellmZ1VwOGNXQzZqakhRIn0.", + "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events", + "answeredBy": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '8241' + Content-Type: + - application/json + Repeatability-First-Sent: + - Fri, 26 May 2023 01:03:27 GMT + Repeatability-Request-ID: + - 12f08a39-c9bf-4df2-aa56-e88cbbf59cda + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:03:27 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections:answer?api-version=2023-03-06 + response: + body: + string: '{"callConnectionId":"411f1200-7e58-4dd9-bcdd-6cb1820a5113","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}],"callConnectionState":"unknown","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"correlationId":"2cf9712f-c610-4279-8784-cb5984849859","answeredBy":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + headers: + content-length: + - '1029' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:03:27 GMT + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - 2cf9712f-c610-4279-8784-cb5984849859 + status: + code: 200 + message: OK +- request: + body: '{"playSources": [{"kind": "file", "file": {"uri": "https://acstestapp1.azurewebsites.net/audio/bot-hold-music-1.wav"}}], + "playTo": [], "playOptions": {"loop": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '166' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:04:14 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1:play?api-version=2023-03-06 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 26 May 2023 01:04:15 GMT + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - 2cf9712f-c610-4279-8784-cb5984849859 + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Repeatability-First-Sent: + - Fri, 26 May 2023 01:04:50 GMT + Repeatability-Request-ID: + - 794c809b-3ac6-4bfc-b272-511d1e2b1585 + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:04:50 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections/411f1200-7e58-4dd9-bcdd-6cb1820a5113:terminate?api-version=2023-03-06 + response: + body: + string: '' + headers: + date: + - Fri, 26 May 2023 01:04:50 GMT + repeatability-result: + - accepted + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - 2cf9712f-c610-4279-8784-cb5984849859 + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_callautomation_client_e2e.test_create_VOIP_call_and_answer_then_hangup.yaml b/sdk/communication/azure-communication-callautomation/tests/recordings/test_callautomation_client_e2e.test_create_VOIP_call_and_answer_then_hangup.yaml new file mode 100644 index 000000000000..32a01bf0c94b --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_callautomation_client_e2e.test_create_VOIP_call_and_answer_then_hangup.yaml @@ -0,0 +1,247 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:05:14 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 + response: + body: + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, + 2021-11-01, 2022-06-01, 2022-10-01, 2023-08-01 + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:05:14 GMT + ms-cv: + - oh84BdkRfkiRBT6FbaxhIw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 34ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:05:14 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 + response: + body: + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, + 2021-11-01, 2022-06-01, 2022-10-01, 2023-08-01 + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:05:14 GMT + ms-cv: + - V1xKzVHqF0Oelm+2vdWv4A.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 34ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.28.2 + method: POST + uri: https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/subscribe?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-0848220069678acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 26 May 2023 01:05:16 GMT + server: + - Kestrel + status: + code: 200 + message: OK +- request: + body: '{"targets": [{"rawId": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2", + "communicationUser": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}], + "source": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}, + "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-0848220069678acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '574' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:05:17 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections?api-version=2023-03-06 + response: + body: + string: '{"callConnectionId":"401f1200-436c-43e8-abfb-d2b7e01e4da7","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}],"callConnectionState":"connecting","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-0848220069678acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}},"correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c"}' + headers: + content-length: + - '901' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:05:17 GMT + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - b94f63c0-e346-4323-ad85-9e7a54200d8c + status: + code: 201 + message: Created +- request: + body: '{"incomingCallContext": "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjYyI6Ikg0c0lBQUFBQUFBQUNzMVhhMi9iT0JiOUs0SVgyQTh6cFVWU2xFUVJNQWFPNDNUY05NOG02V1FRckVGUmxLMVVsalNVL0Vxbi8zMHZaU2R4NDI3YjNaMENvd0NPU0Y2ZWMrNFZIL2QrN0NpWjU2ZGxrNldaa2sxV0ZoM3hzWk9hY21iL1owbEhkTGlRcWhZa1RxU2tjWVFpSDRlSStZeWlPQTRZa21GTXFjSlk4b1NOY2ZzUWpsSS81SWhSSGFPVWN3OWh6amlsR0FkUkVIWmVkWktzcm5LNVBwVXpEZmpRb1l1a0tyT2lHVmsrNmxOR3ROSUlSeFFqbG1wZzBsU2hVSkhVajNHc2ZCWERuRndXazdtY2FEdW5tT2Y1cTA0bFRaT3BySkpiSUJKckxtT2NvQUFuQ1dJWU1IaVFZc1J4RkZBdlpHa2lJd0NhWmttaXdlMVU1clYrMW5LMXJxeTZXcHVGTnYycUFzdktsSlUyemZwQVRqYWNuMTUxbXZJdkNKVG5lWWdxTHA4REZVajZ6VUJ0UURCR1gvaDVmTDRyVURyV0VXYUpoUERJQU5UNEtaSnh5bEdjSkI0TmVlQjVFZGtQbE5GMU9UZEtiMlA5YmEvL1F3VHpyUGhRMnlES3BwRnFDbURUcHFscTRicXl5cnBwbmsybURjeGJyYnYxQi9nbVhWWE83SWk3b0s2cTNCVlNDdWw1VVNKTXVrcnQyQ2psTG9pYmx1YURUbHhHWkFDTFFhTWs1TENvbENSSXlnaVdCdGVTQlZoeG1vWXVEZDJNdUI2TDNJMlVYN0tlRGV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BSMUF4ZDBjMVZGZG9VSGxJV0doTFUweHpaVUZ4ZUhWZmRXczFVbWh1UWtGNmNtZHNlak5WVVRSWVUyRk1kRU5hV25WMlRHVjFORFpJVkZZd1FtVlpPSFZtVkdkbVNuWmtiekphVm1SR1R6UnRjRkZJUjBFeGQxZFNkVTVHV2tWNVRuZzVPVnA1V21wNE4wcElZWHBDYm1GTFIwTXRjMWhxTWs5akxXUTVOM0ppYkRSTVRWSlphVVpPVEdwU1RHSXlUVzFKVnpoQlREWjVPRmxPZEZsT2FXTnlPVjgyTVd0UVRGcGxNV1JET0VOak1HOTNkREozWldwblNYRlpVWG8yYWxKTFYxUnlUWGQxVjNwMlpHY3RNMWhSSW4xOWZRLm9PZDV0QVFWOWNhU09lbVBUZnpMVVY3TmpjM1ZGNHZBcFJucVU1czN5TGw3SWNyak9ZR09ha2pqYUI5RGRxMFZxR19UbDVYQXRTVy1GV21HYWI2c2FFZXk4bE9wcWRvZnpFOVY2VG0xbDNzbGdHQ2dseWxYV18zSWR4Mm80WmJTejZxRWEzRWQ2U0xlbFBEUEZHelFqeTc0QTQtTDFIUmVJVm9obWdhREw5M1RwVGg3RXJqZG9fRmhXcFBRQzdMZmRDMjFSSUVRTWZwZG05NFdzQWUxaTBKNm43RDU5WUxZQTZNVDZzTmlyRlJaWTh6U2I5Sm1DbjBzZ2hxRHNjeWItTHU4ZFlqSWVLNGxvNFgxX1RMNnltcUdwVUMzYklnTGlPODlvcXFWWFF1X1dZRTJhTWZsWHVVWF9XOTNfMEUtdDdhT0dwTXVkOF9yQk9HQk15V2pNUSJ9.", + "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events", + "answeredBy": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '8262' + Content-Type: + - application/json + Repeatability-First-Sent: + - Fri, 26 May 2023 01:05:20 GMT + Repeatability-Request-ID: + - b4989cbd-1bf0-4456-9046-ee16325f7656 + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:05:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections:answer?api-version=2023-03-06 + response: + body: + string: '{"callConnectionId":"411f1200-e44a-4115-b883-062adc55899b","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L19ReHlpYU9OckUtWUlHVWpCbWpLSUE/aT0yJmU9NjM4MjA2NTU3OTUyMzYxMDc1","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}],"callConnectionState":"unknown","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}},"correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c","answeredBy":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}}' + headers: + content-length: + - '1029' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 26 May 2023 01:05:20 GMT + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - b94f63c0-e346-4323-ad85-9e7a54200d8c + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Repeatability-First-Sent: + - Fri, 26 May 2023 01:06:07 GMT + Repeatability-Request-ID: + - ae9a8c8e-5319-4785-bbd9-d2b8c185bbd1 + User-Agent: + - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + x-ms-date: + - Fri, 26 May 2023 01:06:07 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/calling/callConnections/411f1200-e44a-4115-b883-062adc55899b:terminate?api-version=2023-03-06 + response: + body: + string: '' + headers: + date: + - Fri, 26 May 2023 01:06:06 GMT + repeatability-result: + - accepted + x-cache: + - CONFIG_NOCACHE + x-microsoft-skype-chain-id: + - b94f63c0-e346-4323-ad85-9e7a54200d8c + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_create_VOIP_call_and_answer_then_hangup.txt b/sdk/communication/azure-communication-callautomation/tests/recordings/test_create_VOIP_call_and_answer_then_hangup.txt new file mode 100644 index 000000000000..dca0afa2fb5f --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_create_VOIP_call_and_answer_then_hangup.txt @@ -0,0 +1,4 @@ +{"to":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}},"from":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}},"serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94L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k1kRU5hV25WMlRHVjFORFpJVkZZd1FtVlpPSFZtVkdkbVNuWmtiekphVm1SR1R6UnRjRkZJUjBFeGQxZFNkVTVHV2tWNVRuZzVPVnA1V21wNE4wcElZWHBDYm1GTFIwTXRjMWhxTWs5akxXUTVOM0ppYkRSTVRWSlphVVpPVEdwU1RHSXlUVzFKVnpoQlREWjVPRmxPZEZsT2FXTnlPVjgyTVd0UVRGcGxNV1JET0VOak1HOTNkREozWldwblNYRlpVWG8yYWxKTFYxUnlUWGQxVjNwMlpHY3RNMWhSSW4xOWZRLm9PZDV0QVFWOWNhU09lbVBUZnpMVVY3TmpjM1ZGNHZBcFJucVU1czN5TGw3SWNyak9ZR09ha2pqYUI5RGRxMFZxR19UbDVYQXRTVy1GV21HYWI2c2FFZXk4bE9wcWRvZnpFOVY2VG0xbDNzbGdHQ2dseWxYV18zSWR4Mm80WmJTejZxRWEzRWQ2U0xlbFBEUEZHelFqeTc0QTQtTDFIUmVJVm9obWdhREw5M1RwVGg3RXJqZG9fRmhXcFBRQzdMZmRDMjFSSUVRTWZwZG05NFdzQWUxaTBKNm43RDU5WUxZQTZNVDZzTmlyRlJaWTh6U2I5Sm1DbjBzZ2hxRHNjeWItTHU4ZFlqSWVLNGxvNFgxX1RMNnltcUdwVUMzYklnTGlPODlvcXFWWFF1X1dZRTJhTWZsWHVVWF9XOTNfMEUtdDdhT0dwTXVkOF9yQk9HQk15V2pNUSJ9.","correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c"} +[{"id":"6ddc2703-f5e0-40a6-8f90-2bda24fa6e55","source":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7","type":"Microsoft.Communication.CallConnected","data":{"callConnectionId":"401f1200-436c-43e8-abfb-d2b7e01e4da7","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L19ReHlpYU9OckUtWUlHVWpCbWpLSUE/aT0yJmU9NjM4MjA2NTU3OTUyMzYxMDc1","correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c"},"time":"2023-05-26T01:05:23.3615787\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7"}] +[{"id":"73ef2fa7-1599-481f-a795-66fc8913fa60","source":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7","type":"Microsoft.Communication.ParticipantsUpdated","data":{"participants":[{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-42eb-f883-084822006967"}},"isMuted":false},{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f578-4333-2c8a-0848220066a2"}},"isMuted":false}],"sequenceNumber":1,"callConnectionId":"401f1200-436c-43e8-abfb-d2b7e01e4da7","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L19ReHlpYU9OckUtWUlHVWpCbWpLSUE/aT0yJmU9NjM4MjA2NTU3OTUyMzYxMDc1","correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c"},"time":"2023-05-26T01:05:23.3460145\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7"}] +[{"id":"ac12eb61-8d26-47a4-8dcc-cef65e1a524b","source":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7","type":"Microsoft.Communication.CallDisconnected","data":{"callConnectionId":"401f1200-436c-43e8-abfb-d2b7e01e4da7","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L19ReHlpYU9OckUtWUlHVWpCbWpLSUE/aT0yJmU9NjM4MjA2NTU3OTUyMzYxMDc1","correlationId":"b94f63c0-e346-4323-ad85-9e7a54200d8c"},"time":"2023-05-26T01:06:07.4951889\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-436c-43e8-abfb-d2b7e01e4da7"}] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt b/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt new file mode 100644 index 000000000000..a3350d86fd9f --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt @@ -0,0 +1,5 @@ +{"to":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}},"from":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","callerDisplayName":"","incomingCallContext":"eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.ey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1V1dwelIwSnZWSFJ3TVVsMU1XUm1TRUpTVG1vMFdIWTRUMEZwTkdGUlFUZFJJbjE5ZlEuQzhMbVZBQm5xLWZBaUtZVWlIWV9DNFNyODZmRFFwdGtCOTZ5TFlWM3BqcnZpcmlUOVB0ZFVDbXN0ODNoLUR6X1o4c2hFQUx3eVVzUHBOa1RwVmFZWmVDUmxLcS1UblVycUw3N28zVE5Nc0dqRHVEQ1ZvdXdEcXJfbUVGd1RFM08wS1pUQnRmb2kxUUNGSGFuWlRWcnpWV0phT3hLRjBpQy1LcmY1ak5jZVZTVGJBcGFPZlJxUlBsWk9DY3ljYXVtSHd2YWxwdzFTQ0hOVjFLYjMtMWNHZkQ3TWpZWnlBRmFhM051Q3Jhb2dERFN4YkRreVVaNHcxYjlrdHV6dGx6ZUhNTF9HNjd0cVBiemVWT3drdll6LVNmVjlzX1Ryekd6dHJEQ2xBdnBVZU1Ba3ptNjFPLW94ZS1Qa1BFZFVoSlhzTEU3RGQ4ellmZ1VwOGNXQzZqakhRIn0.","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"} +[{"id":"352fa15e-7cf8-4d50-8e4e-e81d6bc0b3ff","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.ParticipantsUpdated","data":{"participants":[{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"isMuted":false},{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}},"isMuted":false}],"sequenceNumber":1,"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:03:30.5108052\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] +[{"id":"b6de2630-394c-4233-870f-12d2d586c3bb","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.CallConnected","data":{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:03:30.5108052\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] +[{"id":"219f832a-7c50-48af-9589-af2c733ce4c7","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.PlayCompleted","data":{"resultInformation":{"code":200,"subCode":0,"message":"Action completed successfully."},"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:04:23.5417589\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] +[{"id":"f1ce006f-77dd-46d7-a623-02b034cf2836","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.CallDisconnected","data":{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:04:51.5560941\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py index 4e5afd302abe..098c7b55354e 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py @@ -47,42 +47,42 @@ def setUp(self): def test_play(self): mock_play = Mock() self.call_media_operations.play = mock_play - play_source = FileSource(url=self.url) + play_source = [FileSource(url=self.url)] self.call_connection_client.play_media(play_source=play_source, play_to=[self.target_user]) expected_play_request = PlayRequest( - play_source_info=play_source._to_generated(), + play_sources=[x._to_generated() for x in play_source], play_to=[serialize_identifier(self.target_user)], play_options=PlayOptions(loop=False) ) mock_play.assert_called_once() actual_play_request = mock_play.call_args[0][1] - self.assertEqual(expected_play_request.play_source_info.source_type, actual_play_request.play_source_info.source_type) - self.assertEqual(expected_play_request.play_source_info.file_source.uri, actual_play_request.play_source_info.file_source.uri) - self.assertEqual(expected_play_request.play_source_info.play_source_id, actual_play_request.play_source_info.play_source_id) + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual(expected_play_request.play_sources[0].play_source_cache_id, actual_play_request.play_sources[0].play_source_cache_id) self.assertEqual(expected_play_request.play_to[0]['raw_id'], actual_play_request.play_to[0]['raw_id']) self.assertEqual(expected_play_request.play_options, actual_play_request.play_options) def test_play_to_all(self): mock_play = Mock() self.call_media_operations.play = mock_play - play_source = FileSource(url=self.url) + play_source = [FileSource(url=self.url)] self.call_connection_client.play_media_to_all(play_source=play_source) expected_play_request = PlayRequest( - play_source_info=play_source._to_generated(), + play_sources=[x._to_generated() for x in play_source], play_to=[], play_options=PlayOptions(loop=False) ) mock_play.assert_called_once() actual_play_request = mock_play.call_args[0][1] - self.assertEqual(expected_play_request.play_source_info.source_type, actual_play_request.play_source_info.source_type) - self.assertEqual(expected_play_request.play_source_info.file_source.uri, actual_play_request.play_source_info.file_source.uri) - self.assertEqual(expected_play_request.play_source_info.play_source_id, actual_play_request.play_source_info.play_source_id) + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual(expected_play_request.play_sources[0].play_source_cache_id, actual_play_request.play_sources[0].play_source_cache_id) self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) self.assertEqual(expected_play_request.play_options, actual_play_request.play_options) @@ -132,8 +132,8 @@ def test_recognize(self): ) self.assertEqual(expected_recognize_request.recognize_input_type, actual_recognize_request.recognize_input_type) - self.assertEqual(expected_recognize_request.play_prompt.source_type, actual_recognize_request.play_prompt.source_type) - self.assertEqual(expected_recognize_request.play_prompt.file_source.uri, actual_recognize_request.play_prompt.file_source.uri) + self.assertEqual(expected_recognize_request.play_prompt.kind, actual_recognize_request.play_prompt.kind) + self.assertEqual(expected_recognize_request.play_prompt.file.uri, actual_recognize_request.play_prompt.file.uri) self.assertEqual(expected_recognize_request.interrupt_call_media_operation, actual_recognize_request.interrupt_call_media_operation) self.assertEqual(expected_recognize_request.operation_context, actual_recognize_request.operation_context) self.assertEqual(expected_recognize_request.recognize_options.target_participant, actual_recognize_request.recognize_options.target_participant) diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py new file mode 100644 index 000000000000..8e84033d42e7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py @@ -0,0 +1,126 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import os +import pytest +import inspect +from datetime import timedelta + +from azure.communication.callautomation import CallAutomationClient, CallConnectionClient, CallInvite, FileSource +from azure.communication.callautomation._shared.utils import parse_connection_str +from azure.communication.identity import CommunicationIdentityClient + +from _shared.asynctestcase import AsyncCommunicationTestCase +from call_automation_automated_live_test_base import CallAutomationAutomatedLiveTestBase + +play_source_uri = 'https://acstestapp1.azurewebsites.net/audio/bot-hold-music-1.wav' + +class CallMediaClientAsyncAutomatedLiveTest(CallAutomationAutomatedLiveTestBase): + def setUp(self): + super(CallMediaClientAsyncAutomatedLiveTest, self).setUp() + self.connection_str = os.environ.get('COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING', 'endpoint=https://sanitized.communication.azure.com/;accesskey=REDACTED') + self.identity_client = CommunicationIdentityClient.from_connection_string(self.connection_str) + endpoint, _ = parse_connection_str(self.connection_str) + self.endpoint = endpoint + self.test_name = '' + + def tearDown(self): + super(CallMediaClientAsyncAutomatedLiveTest, self).tearDown() + self.persist_events(self.test_name) + + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_play_media_in_a_call(self): + self.test_name = inspect.currentframe().f_code.co_name + self.load_persisted_events(self.test_name) + call_connection_list = [] + print("starting test") + try: + # create caller and receiver + print('TEST SCENARIO: _play_media_in_a_call') + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source_identity=caller) # for creating call + call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source_identity=target) # answering call, all other actions + unique_id = self.service_bus_with_new_call(caller, target) + + # create a call + call_invite = CallInvite(target=target) + create_call_result = call_automation_client_caller.create_call(target_participant=call_invite, callback_url=(self.dispatcher_callback + "?q={}".format(unique_id))) + if create_call_result is None: + raise ValueError("Invalid create_call result") + + caller_connection_id = create_call_result.call_connection_id + if caller_connection_id is None: + raise ValueError("Caller connection ID is None") + print('Caller connection ID: ' + caller_connection_id) + + # wait for incomingCallContext + self.wait_for_messages(unique_id, timedelta(seconds=30)) + incoming_call_context = self.incoming_call_context_store[unique_id] + if incoming_call_context is None: + raise ValueError("Incoming call context is None") + + # answer the call + answer_call_result = call_automation_client_target.answer_call(incoming_call_context=incoming_call_context, callback_url=self.dispatcher_callback) + if answer_call_result is None: + raise ValueError("Invalid answer_call result") + + receiver_connection_id = answer_call_result.call_connection_id + print('Receiver connection ID: ' + receiver_connection_id) + receiver_call_connection = CallConnectionClient.from_connection_string(self.connection_str, answer_call_result.call_connection_id) + call_connection_list.append(receiver_call_connection) + + # check events to caller side + self.wait_for_messages(unique_id, timedelta(seconds=8)) + caller_connected_event = self.check_for_event(event_type='CallConnected', call_connection_id=caller_connection_id) + caller_participant_updated_event = self.check_for_event(event_type='ParticipantsUpdated', call_connection_id=caller_connection_id) + if caller_connected_event is None: + raise ValueError("Caller CallConnected event is None") + if caller_participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + + # check events to receiver side + self.wait_for_messages(unique_id, timedelta(seconds=8)) + receiver_connected_event = self.check_for_event(event_type='CallConnected', call_connection_id=caller_connection_id) + receiver_participant_updated_event = self.check_for_event(event_type='ParticipantsUpdated', call_connection_id=caller_connection_id) + if receiver_connected_event is None: + raise ValueError("Receiver CallConnected event is None") + if receiver_participant_updated_event is None: + raise ValueError("Receiver ParticipantsUpdated event is None") + + # play media to all participants + caller_call_connection = CallConnectionClient.from_connection_string(self.connection_str, create_call_result.call_connection_id) + file_source = [FileSource(url=play_source_uri)] + + caller_call_connection.play_media_to_all( + play_source=file_source, + ) + + # check for PlayCompleted event + self.wait_for_messages(unique_id, timedelta(seconds=20)) + play_completed_event = self.check_for_event(event_type='PlayCompleted', call_connection_id=caller_connection_id) + if play_completed_event is None: + raise ValueError("PlayCompleted event is None") + + # hang up the call + receiver_call_connection.hang_up(is_for_everyone=True) + self.wait_for_messages(unique_id, timedelta(seconds=8)) + + # check if call terminated + receiver_call_disconnected_event = self.check_for_event(event_type='CallDisconnected', call_connection_id=caller_connection_id) + if receiver_call_disconnected_event is None: + raise ValueError("Receiver CallDisconnected event is None") + + call_connection_list.clear() + + except Exception as e: + print(f"Threw Exception: {e}") + raise + finally: + # hang up the call + for cc in call_connection_list: + cc.hang_up(is_for_everyone=True) \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py new file mode 100644 index 000000000000..2fea2a80ca0e --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py @@ -0,0 +1,111 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import os +import pytest +import inspect +from datetime import timedelta + +from azure.communication.callautomation import CallAutomationClient, CallConnectionClient, CallInvite +from azure.communication.callautomation._shared.utils import parse_connection_str +from azure.communication.identity import CommunicationIdentityClient + +from _shared.asynctestcase import AsyncCommunicationTestCase +from call_automation_automated_live_test_base import CallAutomationAutomatedLiveTestBase + + +class CallAutomationClientAsyncAutomatedLiveTest(CallAutomationAutomatedLiveTestBase): + def setUp(self): + super(CallAutomationClientAsyncAutomatedLiveTest, self).setUp() + self.connection_str = os.environ.get('COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING', 'endpoint=https://sanitized.communication.azure.com/;accesskey=QWNjZXNzS2V5') + self.identity_client = CommunicationIdentityClient.from_connection_string(self.connection_str) + endpoint, _ = parse_connection_str(self.connection_str) + self.endpoint = endpoint + self.test_name = '' + + def tearDown(self): + super(CallAutomationClientAsyncAutomatedLiveTest, self).tearDown() + self.persist_events(self.test_name) + + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_create_VOIP_call_and_answer_then_hangup(self): + call_connection_list = [] + self.test_name = inspect.currentframe().f_code.co_name + self.load_persisted_events(self.test_name) + print("starting test") + try: + # create caller and receiver + print('TEST SCENARIO: _create_VOIP_call_and_answer_then_hangup') + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source_identity=caller) # for creating call + call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source_identity=target) # answering call, all other actions + unique_id = self.service_bus_with_new_call(caller, target) + + # create a call + call_invite = CallInvite(target=target) + create_call_result = call_automation_client_caller.create_call(target_participant=call_invite, callback_url=(self.dispatcher_callback + "?q={}".format(unique_id))) + if create_call_result is None: + raise ValueError("Invalid create_call_result") + + caller_connection_id = create_call_result.call_connection_id + if caller_connection_id is None: + raise ValueError("Caller connection ID is None") + print('Caller connection ID: ' + caller_connection_id) + + # wait for incomingCallContext + self.wait_for_messages(unique_id, timedelta(seconds=30)) + incoming_call_context = self.incoming_call_context_store[unique_id] + if incoming_call_context is None: + raise ValueError("Incoming call context is None") + + # answer the call + answer_call_result = call_automation_client_target.answer_call(incoming_call_context=incoming_call_context, callback_url=self.dispatcher_callback) + if answer_call_result is None: + raise ValueError("Invalid answer_call result") + + receiver_connection_id = answer_call_result.call_connection_id + print('Receiver connection ID: ' + receiver_connection_id) + receiver_call_connection = CallConnectionClient.from_connection_string(self.connection_str, answer_call_result.call_connection_id) + call_connection_list.append(receiver_call_connection) + + # check events to caller side + self.wait_for_messages(unique_id, timedelta(seconds=8)) + caller_connected_event = self.check_for_event(event_type='CallConnected', call_connection_id=caller_connection_id) + caller_participant_updated_event = self.check_for_event(event_type='ParticipantsUpdated', call_connection_id=caller_connection_id) + if caller_connected_event is None: + raise ValueError("Caller CallConnected event is None") + if caller_participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + + # check events to receiver side + self.wait_for_messages(unique_id, timedelta(seconds=8)) + receiver_connected_event = self.check_for_event(event_type='CallConnected', call_connection_id=caller_connection_id) + receiver_participant_updated_event = self.check_for_event(event_type='ParticipantsUpdated', call_connection_id=caller_connection_id) + if receiver_connected_event is None: + raise ValueError("Receiver CallConnected event is None") + if receiver_participant_updated_event is None: + raise ValueError("Receiver ParticipantsUpdated event is None") + + # hang up the call + receiver_call_connection.hang_up(is_for_everyone=True) + self.wait_for_messages(unique_id, timedelta(seconds=10)) + + # check if call terminated + receiver_call_disconnected_event = self.check_for_event(event_type='CallDisconnected', call_connection_id=caller_connection_id) + if receiver_call_disconnected_event is None: + raise ValueError("Receiver CallDisconnected event is None") + + call_connection_list.clear() + + except Exception as e: + print(f"Threw Exception: {e}") + raise + finally: + # hang up the call + for cc in call_connection_list: + cc.hang_up(is_for_everyone=True) \ No newline at end of file From 72ffd6520507bbede4ea945b5eb05dd61c69423c Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Thu, 25 May 2023 22:48:33 -0700 Subject: [PATCH 3/8] update changelog --- .../CHANGELOG.md | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/sdk/communication/azure-communication-callautomation/CHANGELOG.md b/sdk/communication/azure-communication-callautomation/CHANGELOG.md index 817089099d4b..447fd14dea05 100644 --- a/sdk/communication/azure-communication-callautomation/CHANGELOG.md +++ b/sdk/communication/azure-communication-callautomation/CHANGELOG.md @@ -1,19 +1,23 @@ -# Release History +# Release History -## 1.0.0b1 (Unreleased) -Call Automation enables developers to build call workflows. Personalise customer interactions by listening to call events and take actions based on your business logic. +## 1.0.0 (2023-05-29) +Call Automation enables developers to build call workflows. Personalise customer interactions by listening to call events and take actions based on your business logic. For more information, please see the [README][read_me]. -### Features Added -- Create outbound calls to an Azure Communication Service user or a phone number. -- Answer/Redirect/Reject incoming call from an Azure Communication Service user or a phone number. -- Transfer the call to another participant. -- List, add or remove participants from the call. -- Hangup or terminate the call. -- Play audio files to one or more participants in the call. -- Recognize incoming DTMF in the call. -- Record calls with option to start/resume/stop. -- Record mixed and unmixed audio recordings. -- Download recordings. -- Parse various events happening in the call, such as CallConnected and PlayCompleted event. -- Start/Stop continuous DTMF recognition by subscribing/unsubscribing to tones. -- Send DTMF tones to a participant in the call. \ No newline at end of file +### Features Added +- Create outbound calls to an Azure Communication Service user or a phone number. +- Answer/Redirect/Reject incoming call from an Azure Communication Service user or a phone number. +- Transfer the call to another participant. +- List, add or remove participant from the call. +- Hangup or terminate the call. +- Play audio files to one or more participants in the call. +- Recognize incoming DTMF in the call. +- Record calls with option to start/resume/stop. +- Record mixed and unmixed audio recordings. +- Download recordings. + + +[read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.CallAutomation/README.md +[Overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation +[Demo Video]: https://ignite.microsoft.com/sessions/14a36f87-d1a2-4882-92a7-70f2c16a306a +[Incoming Call Concept]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/incoming-call-notification +[Build a customer interaction workflow using Call Automation]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions \ No newline at end of file From 40a118681de0ae2e155ebc2640278f0c213a2a5b Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Fri, 26 May 2023 14:04:19 -0700 Subject: [PATCH 4/8] address PR comments --- .../callautomation/_call_automation_client.py | 14 +-- .../callautomation/_call_connection_client.py | 16 ++-- .../communication/callautomation/_models.py | 8 +- .../communication/callautomation/_version.py | 2 +- .../aio/_call_automation_client_async.py | 14 +-- .../aio/_call_connection_client_async.py | 16 ++-- .../setup.py | 2 +- ..._client_e2e.test_play_media_in_a_call.yaml | 86 +++++++++---------- .../recordings/test_play_media_in_a_call.txt | 10 +-- .../tests/test_call_media_client.py | 12 +-- .../tests/test_call_media_client_e2e.py | 8 +- .../tests/test_callautomation_client_e2e.py | 4 +- 12 files changed, 96 insertions(+), 96 deletions(-) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py index c853cc9e0d06..46851b780b4c 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py @@ -68,9 +68,9 @@ class CallAutomationClient(object): or ~azure.core.credentials.AzureKeyCredential :keyword api_version: Azure Communication Call Automation API version. :paramtype api_version: str - :keyword source_identity: ACS User Identity to be used when the call is created or answered. + :keyword source: ACS User Identity to be used when the call is created or answered. If not provided, service will generate one. - :paramtype source_identity: ~azure.communication.callautomation.CommunicationUserIdentifier + :paramtype source: ~azure.communication.callautomation.CommunicationUserIdentifier """ def __init__( self, @@ -78,7 +78,7 @@ def __init__( credential: Union['TokenCredential', 'AzureKeyCredential'], *, api_version: Optional[str] = None, - source_identity: Optional['CommunicationUserIdentifier'] = None, + source: Optional['CommunicationUserIdentifier'] = None, **kwargs ) -> None: if not credential: @@ -105,7 +105,7 @@ def __init__( self._call_recording_client = self._client.call_recording self._downloader = ContentDownloader(self._call_recording_client) - self.source_identity = source_identity + self.source = source @classmethod def from_connection_string( @@ -174,7 +174,7 @@ def create_call( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, source=serialize_communication_user_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context, ) @@ -223,7 +223,7 @@ def create_group_call( source_caller_id_number) if source_caller_id_number else None, source_display_name=source_display_name, source=serialize_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context, ) @@ -263,7 +263,7 @@ def answer_call( incoming_call_context=incoming_call_context, callback_uri=callback_url, answered_by=serialize_communication_user_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context ) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py index bbfd40f36f38..8051c2473757 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py @@ -300,7 +300,7 @@ def remove_participant( @distributed_trace def play_media( self, - play_source: List['FileSource'], + play_sources: List['FileSource'], play_to: List['CommunicationIdentifier'], *, loop: Optional[bool] = False, @@ -309,8 +309,8 @@ def play_media( ) -> None: """Play media to specific participant(s) in this call. - :param play_source: A PlaySource representing the source to play. - :type play_source: ~azure.communication.callautomation.FileSource + :param play_sources: A list of PlaySources representing the sources to play. + :type play_sources: List[~azure.communication.callautomation.FileSource] :param play_to: The targets to play media to. :type play_to: list[~azure.communication.callautomation.CommunicationIdentifier] :keyword loop: if the media should be repeated until cancelled. @@ -322,7 +322,7 @@ def play_media( :raises ~azure.core.exceptions.HttpResponseError: """ play_request = PlayRequest( - play_sources=[source._to_generated() for source in play_source],#pylint:disable=protected-access + play_sources=[play_source._to_generated() for play_source in play_sources],#pylint:disable=protected-access play_to=[serialize_identifier(identifier) for identifier in play_to], play_options=PlayOptions(loop=loop), @@ -334,7 +334,7 @@ def play_media( @distributed_trace def play_media_to_all( self, - play_source: List['FileSource'], + play_sources: List['FileSource'], *, loop: Optional[bool] = False, operation_context: Optional[str] = None, @@ -342,8 +342,8 @@ def play_media_to_all( ) -> None: """Play media to all participants in this call. - :param play_source: A PlaySource representing the source to play. - :type play_source: ~azure.communication.callautomation.FileSource + :param play_sources: A list of PlaySources representing the sources to play. + :type play_sources: List[~azure.communication.callautomation.FileSource] :keyword loop: if the media should be repeated until cancelled. :paramtype loop: bool :keyword operation_context: Value that can be used to track this call and its associated events. @@ -352,7 +352,7 @@ def play_media_to_all( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - self.play_media(play_source=play_source, + self.play_media(play_sources=play_sources, play_to=[], loop=loop, operation_context=operation_context, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py index e03ada47c131..a42b9d2fb69d 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py @@ -160,8 +160,8 @@ class FileSource(object): :ivar url: Url for the audio file to be played. :vartype url: str - :ivar play_source_id: source id of the play media. - :vartype play_source_id: str + :ivar play_source_cache_id: source id of the play media. + :vartype play_source_cache_id: str """ def __init__( self, @@ -174,8 +174,8 @@ def __init__( :param url: Url for the audio file to be played. :type url: str - :keyword play_source_id: source id of the play media. - :paramtype play_source_id: str + :keyword play_source_cache_id: source id of the play media. + :paramtype play_source_cache_id: str """ super().__init__(**kwargs) self.url = url diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_version.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_version.py index dfe5905f6f88..73dc17e3c606 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_version.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_version.py @@ -4,6 +4,6 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" SDK_MONIKER = f"communication-callautomation/{format(VERSION)}" diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py index cbc4e3c0ac8f..3785ece86a28 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py @@ -71,9 +71,9 @@ class CallAutomationClient(object): or ~azure.core.credentials.AzureKeyCredential :keyword api_version: Azure Communication Call Automation API version. :paramtype api_version: str - :keyword source_identity: ACS User Identity to be used when the call is created or answered. + :keyword source: ACS User Identity to be used when the call is created or answered. If not provided, service will generate one. - :paramtype source_identity: ~azure.communication.callautomation.CommunicationUserIdentifier + :paramtype source: ~azure.communication.callautomation.CommunicationUserIdentifier """ def __init__( self, @@ -81,7 +81,7 @@ def __init__( credential: Union['AsyncTokenCredential', 'AzureKeyCredential'], *, api_version: Optional[str] = None, - source_identity: Optional['CommunicationUserIdentifier'] = None, + source: Optional['CommunicationUserIdentifier'] = None, **kwargs ) -> None: if not credential: @@ -108,7 +108,7 @@ def __init__( self._call_recording_client = self._client.call_recording self._downloader = ContentDownloader(self._call_recording_client) - self.source_identity = source_identity + self.source = source @classmethod def from_connection_string( @@ -177,7 +177,7 @@ async def create_call( target_participant.source_caller_id_number) if target_participant.source_caller_id_number else None, source_display_name=target_participant.source_display_name, source=serialize_communication_user_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context, ) @@ -227,7 +227,7 @@ async def create_group_call( source_caller_id_number) if source_caller_id_number else None, source_display_name=source_display_name, source=serialize_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context, ) @@ -266,7 +266,7 @@ async def answer_call( incoming_call_context=incoming_call_context, callback_uri=callback_url, answered_by=serialize_communication_user_identifier( - self.source_identity) if self.source_identity else None, + self.source) if self.source else None, operation_context=operation_context ) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py index f7ee8afa451d..195e0c7b8b55 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py @@ -304,7 +304,7 @@ async def remove_participant( @distributed_trace_async async def play_media( self, - play_source: 'FileSource', + play_sources: List['FileSource'], play_to: List['CommunicationIdentifier'], *, loop: Optional[bool] = False, @@ -313,8 +313,8 @@ async def play_media( ) -> None: """Play media to specific participant(s) in the call. - :param play_source: A PlaySource representing the source to play. - :type play_source: ~azure.communication.callautomation.FileSource + :param play_sources: A list of PlaySources representing the sources to play. + :type play_sources: List[~azure.communication.callautomation.FileSource] :param play_to: The targets to play media to. :type play_to: list[~azure.communication.callautomation.CommunicationIdentifier] :keyword loop: if the media should be repeated until cancelled. @@ -326,7 +326,7 @@ async def play_media( :raises ~azure.core.exceptions.HttpResponseError: """ play_request = PlayRequest( - play_sources=[source._to_generated() for source in play_source],#pylint:disable=protected-access + play_sources=[play_source._to_generated() for play_source in play_sources],#pylint:disable=protected-access play_to=[serialize_identifier(identifier) for identifier in play_to], play_options=PlayOptions(loop=loop), @@ -338,7 +338,7 @@ async def play_media( @distributed_trace_async async def play_media_to_all( self, - play_source: 'FileSource', + play_sources: List['FileSource'], *, loop: Optional[bool] = False, operation_context: Optional[str] = None, @@ -346,8 +346,8 @@ async def play_media_to_all( ) -> None: """Play media to all participants in the call. - :param play_source: A PlaySource representing the source to play. - :type play_source: ~azure.communication.callautomation.FileSource + :param play_sources: A list of PlaySources representing the sources to play. + :type play_sources: List[~azure.communication.callautomation.FileSource] :keyword loop: if the media should be repeated until cancelled. :paramtype loop: bool :keyword operation_context: Value that can be used to track this call and its associated events. @@ -356,7 +356,7 @@ async def play_media_to_all( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - await self.play_media(play_source=play_source, play_to=[], + await self.play_media(play_sources=play_sources, play_to=[], loop=loop, operation_context=operation_context, **kwargs) diff --git a/sdk/communication/azure-communication-callautomation/setup.py b/sdk/communication/azure-communication-callautomation/setup.py index 806b7f93bfee..26889cddb73f 100644 --- a/sdk/communication/azure-communication-callautomation/setup.py +++ b/sdk/communication/azure-communication-callautomation/setup.py @@ -39,7 +39,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", 'Programming Language :: Python', "Programming Language :: Python :: 3 :: Only", 'Programming Language :: Python :: 3', diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml b/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml index ca05c4b3adc7..06981b5f6e8b 100644 --- a/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_call_media_client_e2e.test_play_media_in_a_call.yaml @@ -15,14 +15,14 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:03:20 GMT + - Fri, 26 May 2023 20:56:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 response: body: - string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}}' + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 26 May 2023 01:03:20 GMT + - Fri, 26 May 2023 20:56:23 GMT ms-cv: - - iEQZjcEcEU2bNNySjJURAw.0 + - aySs0Hd5bUGnbujCly+04Q.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 20ms + - 50ms status: code: 201 message: Created @@ -62,14 +62,14 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.4.0b2 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:03:20 GMT + - Fri, 26 May 2023 20:56:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2022-10-01 response: body: - string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + string: '{"identity":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, @@ -79,9 +79,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 26 May 2023 01:03:20 GMT + - Fri, 26 May 2023 20:56:23 GMT ms-cv: - - gZMXExE7j0a8/ySSaXa9Xg.0 + - 3/ARoWVUBEar3cDg/2vARw.0 request-context: - appId= strict-transport-security: @@ -89,7 +89,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 34ms + - 33ms status: code: 201 message: Created @@ -107,7 +107,7 @@ interactions: User-Agent: - python-requests/2.28.2 method: POST - uri: https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/subscribe?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94 + uri: https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/subscribe?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365 response: body: string: '' @@ -115,17 +115,17 @@ interactions: content-length: - '0' date: - - Fri, 26 May 2023 01:03:22 GMT + - Fri, 26 May 2023 20:56:26 GMT server: - Kestrel status: code: 200 message: OK - request: - body: '{"targets": [{"rawId": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94", - "communicationUser": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}], - "source": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}, - "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}' + body: '{"targets": [{"rawId": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365", + "communicationUser": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}], + "source": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}, + "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}' headers: Accept: - application/json @@ -138,34 +138,34 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + - azsdk-python-communication-callautomation/1.0.0 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:03:22 GMT + - Fri, 26 May 2023 20:56:26 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/calling/callConnections?api-version=2023-03-06 response: body: - string: '{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}],"callConnectionState":"connecting","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-0848220066808acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"correlationId":"2cf9712f-c610-4279-8784-cb5984849859"}' + string: '{"callConnectionId":"401f1200-a57f-424e-b995-7be160203c13","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}],"callConnectionState":"connecting","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events?q=8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed8acs1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}},"correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"}' headers: content-length: - '901' content-type: - application/json; charset=utf-8 date: - - Fri, 26 May 2023 01:03:23 GMT + - Fri, 26 May 2023 20:56:27 GMT x-cache: - CONFIG_NOCACHE x-microsoft-skype-chain-id: - - 2cf9712f-c610-4279-8784-cb5984849859 + - 64364cfa-9746-46cb-ab1c-b9864a011fde status: code: 201 message: Created - request: - body: '{"incomingCallContext": "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjYyI6Ikg0c0lBQUFBQUFBQUNzMVlhMi9iT0JiOUs0SVhtQStMMGlJcFNxSUlHQXZiU1JwUEptbWUzZDBnMklDaUtKdU5Ya1BKajdUVC96Nlh0cE80ZFhiYTNaMVpqQk1vSm5sNXpybFhmTnliVHowbGkrS3M3a3h1bE94TVhmWEVwMTV1NjlMOU5WbFA5TGlRcWhVa3phU2thWUtTRU1lSWhZeWlOSTBZa25GS3FjSlk4b3pkNC9XSGNKU0hjWVE0eXltaWlrdUVPZU9VWWh4RkhQZmU5RExUTm9WOFBKT2xCbnpvMEZYVzFLYnFKbzZQeHBoTEhHbVVad2t3Y1JvQ0V0WklNcVpwVHFRbVVRUnpDbGxONTNLcTNaeHFYaFJ2ZW8yMG5WR21rVnNnVEFPU1JWR0c0cHd3eEtJa1JFa0d1a0FnSU5Nd2wxRUNRRE9UWlJyY3ptWFI2aGN0MTQrTlU5ZHF1OUIyMkRSZzJkaTYwYlo3SE1ucGh2UHptMTVYL3c2QkNsbUFjTWJUNTBDRmVjSytHYWdOQ01ib2xjZlQ1N3NDcFRLZVozR1dvM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M1ZHeFhXVmRHWlRSNk1tOTNNMm95TVdSM1JtMXNWa2xqYTBsalVYbHJRV1kxU1hNeU5WTXhha3BzVEZOamFITXdkVmxTWDBKbGNEUTVaRlZ0V0ZSa2NGbFNNVVJhV2xwNVoxTlJJbjE5ZlEuWjFmUDh2dFBjOEF1eGx3NEx3MUtLUFY0OXhjM00ySmEtQ0ROZFBjSEZaci14NGZCbjg4bnFzSGNNU19OM0R2RHNiTzhGRnh2NEdvTm1zU1NzcVlKTHFtTVMzbE83REUxQVotMEo0ZlNkUVBOcFFFUVBuc3BDZ2d5djJScUNnZm4ydEZtc0Vib2p3bDJXWjM1Y3ZnUWlLMXZaOGxqMV9kd0pPbzNaa3RyaE1faHgtdElDcHN4ay1ucWtWN19BYzFtRmo1S0E3d1JYcUZxRmdacENkMm9oRl82cEZWa3VOenk0NVBZWGJSVW1hQjFQYjFaSU9ybF9CNmZKNUV1Um4tTEcxVFVfcEJTcW9Uc1ZONFk4MWk0R1BDSUZSOVg3bXBfSlEwbXJkTFp1VkR4N21nVjdtdU8zNmRRQ3k1VFlVQmU3dzhMc3lmYmM0MEthRW1qMGVLUmNRIn0.", "callbackUri": "https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events", - "answeredBy": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + "answeredBy": {"id": "8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}' headers: Accept: - application/json @@ -174,35 +174,35 @@ interactions: Connection: - keep-alive Content-Length: - - '8241' + - '8273' Content-Type: - application/json Repeatability-First-Sent: - - Fri, 26 May 2023 01:03:27 GMT + - Fri, 26 May 2023 20:56:30 GMT Repeatability-Request-ID: - - 12f08a39-c9bf-4df2-aa56-e88cbbf59cda + - 0f1509b1-cc14-4e82-bf1c-c715dd4c5fc6 User-Agent: - - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + - azsdk-python-communication-callautomation/1.0.0 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:03:27 GMT + - Fri, 26 May 2023 20:56:30 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/calling/callConnections:answer?api-version=2023-03-06 response: body: - string: '{"callConnectionId":"411f1200-7e58-4dd9-bcdd-6cb1820a5113","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}],"callConnectionState":"unknown","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"correlationId":"2cf9712f-c610-4279-8784-cb5984849859","answeredBy":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}}' + string: '{"callConnectionId":"431f1200-7e2b-4066-b9fe-9bb8666d6eeb","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","targets":[{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}],"callConnectionState":"unknown","callbackUri":"https://incomingcalldispatcher.azurewebsites.net/api/servicebuscallback/events","sourceDisplayName":"","source":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}},"correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde","answeredBy":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}}' headers: content-length: - '1029' content-type: - application/json; charset=utf-8 date: - - Fri, 26 May 2023 01:03:27 GMT + - Fri, 26 May 2023 20:56:30 GMT x-cache: - CONFIG_NOCACHE x-microsoft-skype-chain-id: - - 2cf9712f-c610-4279-8784-cb5984849859 + - 64364cfa-9746-46cb-ab1c-b9864a011fde status: code: 200 message: OK @@ -221,13 +221,13 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + - azsdk-python-communication-callautomation/1.0.0 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:04:14 GMT + - Fri, 26 May 2023 20:57:17 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1:play?api-version=2023-03-06 + uri: https://sanitized.communication.azure.com/calling/callConnections/401f1200-a57f-424e-b995-7be160203c13:play?api-version=2023-03-06 response: body: string: '' @@ -235,11 +235,11 @@ interactions: content-length: - '0' date: - - Fri, 26 May 2023 01:04:15 GMT + - Fri, 26 May 2023 20:57:18 GMT x-cache: - CONFIG_NOCACHE x-microsoft-skype-chain-id: - - 2cf9712f-c610-4279-8784-cb5984849859 + - 64364cfa-9746-46cb-ab1c-b9864a011fde status: code: 202 message: Accepted @@ -255,29 +255,29 @@ interactions: Content-Length: - '0' Repeatability-First-Sent: - - Fri, 26 May 2023 01:04:50 GMT + - Fri, 26 May 2023 20:57:53 GMT Repeatability-Request-ID: - - 794c809b-3ac6-4bfc-b272-511d1e2b1585 + - f9cfb00e-9710-4693-97e9-a55efd1a55d7 User-Agent: - - azsdk-python-communication-callautomation/1.0.0b1 Python/3.11.1 (Windows-10-10.0.22621-SP0) + - azsdk-python-communication-callautomation/1.0.0 Python/3.11.1 (Windows-10-10.0.22621-SP0) x-ms-date: - - Fri, 26 May 2023 01:04:50 GMT + - Fri, 26 May 2023 20:57:53 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/calling/callConnections/411f1200-7e58-4dd9-bcdd-6cb1820a5113:terminate?api-version=2023-03-06 + uri: https://sanitized.communication.azure.com/calling/callConnections/431f1200-7e2b-4066-b9fe-9bb8666d6eeb:terminate?api-version=2023-03-06 response: body: string: '' headers: date: - - Fri, 26 May 2023 01:04:50 GMT + - Fri, 26 May 2023 20:57:54 GMT repeatability-result: - accepted x-cache: - CONFIG_NOCACHE x-microsoft-skype-chain-id: - - 2cf9712f-c610-4279-8784-cb5984849859 + - 64364cfa-9746-46cb-ab1c-b9864a011fde status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt b/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt index a3350d86fd9f..c26535075f6c 100644 --- a/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt +++ b/sdk/communication/azure-communication-callautomation/tests/recordings/test_play_media_in_a_call.txt @@ -1,5 +1,5 @@ -{"to":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}},"from":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","callerDisplayName":"","incomingCallContext":"eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjYyI6Ikg0c0lBQUFBQUFBQUNzMVlhMi9iT0JiOUs0SVhtQStMMGlJcFNxSUlHQXZiU1JwUEptbWUzZDBnMklDaUtKdU5Ya1BKajdUVC96Nlh0cE80ZFhiYTNaMVpqQk1vSm5sNXpybFhmTnliVHowbGkrS3M3a3h1bE94TVhmWEVwMTV1NjlMOU5WbFA5TGlRcWhVa3phU2thWUtTRU1lSWhZeWlOSTBZa25GS3FjSlk4b3pkNC9XSGNKU0hjWVE0eXltaWlrdUVPZU9VWWh4RkhQZmU5RExUTm9WOFBKT2xCbnpvMEZYVzFLYnFKbzZQeHBoTEhHbVVad2t3Y1JvQ0V0WklNcVpwVHFRbVVRUnpDbGxONTNLcTNaeHFYaFJ2ZW8yMG5WR21rVnNnVEFPU1JWR0c0cHd3eEtJa1JFa0d1a0FnSU5Nd2wxRUNRRE9UWlJyY3ptWFI2aGN0MTQrTlU5ZHF1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ba3ptNjFPLW94ZS1Qa1BFZFVoSlhzTEU3RGQ4ellmZ1VwOGNXQzZqakhRIn0.","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"} -[{"id":"352fa15e-7cf8-4d50-8e4e-e81d6bc0b3ff","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.ParticipantsUpdated","data":{"participants":[{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-84f2-2c8a-084822006680"}},"isMuted":false},{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f576-8543-0d8b-084822005f94"}},"isMuted":false}],"sequenceNumber":1,"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:03:30.5108052\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] -[{"id":"b6de2630-394c-4233-870f-12d2d586c3bb","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.CallConnected","data":{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:03:30.5108052\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] -[{"id":"219f832a-7c50-48af-9589-af2c733ce4c7","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.PlayCompleted","data":{"resultInformation":{"code":200,"subCode":0,"message":"Action completed successfully."},"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:04:23.5417589\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] -[{"id":"f1ce006f-77dd-46d7-a623-02b034cf2836","source":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1","type":"Microsoft.Communication.CallDisconnected","data":{"callConnectionId":"411f1200-5ea8-4821-96de-3215750672a1","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252LzZwLUtmaXpINEVhV1JKNWdKa3VDdWc/aT0xJmU9NjM4MjA2NTUyNjc1OTIxMDI3","correlationId":"2cf9712f-c610-4279-8784-cb5984849859"},"time":"2023-05-26T01:04:51.5560941\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/411f1200-5ea8-4821-96de-3215750672a1"}] \ No newline at end of file +{"to":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}},"from":{"kind":"communicationUser","rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}},"serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","callerDisplayName":"","incomingCallContext":"eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjYyI6Ikg0c0lBQUFBQUFBQUNzMVliVy9iT0JMK0s0SVAyQSszcFVWU0wzd0JqSU9kT05rMFRlSzQ2VzYzQ0M2Z0tNcG1La3VLSk1kMnV2M3ZON1NkeEsxejI5N2Q3bUVWUUJZNXczbWVHYjdONUZOSHF6dy9MMXViV2ExYVd4WWQrYW1UMWVYTS9kcTBJenRjS3QxSWtxUkswVVFnRVdHR3dpaWtLRW5pRUNtV1VLb3hWandOYi9ENklSeGxJbEZJcHpwR0p0QU1SU0pRT01WWVp5YnR2T3FrdHFseXRUcFhNd1Ayb2NNVWFWWGFvajF4ZUVta0dSVk1JNkZZakVMR01WS2g0VWpwQ0pPRXBqRkpGWXpKVlRHWnE0bHhZNHA1bnIvcVZLcHVyYmFWMmhvaVdSUUdxU0ZJNk1pZzBFUUo0andUaUxPTTZZamdMQ09PemRT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ybF9CNmZKNUV1Um4tTEcxVFVfcEJTcW9Uc1ZONFk4MWk0R1BDSUZSOVg3bXBfSlEwbXJkTFp1VkR4N21nVjdtdU8zNmRRQ3k1VFlVQmU3dzhMc3lmYmM0MEthRW1qMGVLUmNRIn0.","correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"} +[{"id":"9bb7b6a1-2985-42f2-bb36-fbc4d0d0f4a5","source":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13","type":"Microsoft.Communication.ParticipantsUpdated","data":{"participants":[{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-cdc6-e3c7-593a0d00cfed"}},"isMuted":false},{"identifier":{"rawId":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365","kind":"communicationUser","communicationUser":{"id":"8:acs:1bdaa2b9-9507-4542-bb64-a7b22c00a8d4_00000018-f9ba-ce1c-2c8a-08482200c365"}},"isMuted":false}],"sequenceNumber":1,"callConnectionId":"401f1200-a57f-424e-b995-7be160203c13","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"},"time":"2023-05-26T20:56:33.754957\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13"}] +[{"id":"4fa51afe-442e-4ccd-98b6-5eb83e6caccc","source":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13","type":"Microsoft.Communication.CallConnected","data":{"callConnectionId":"401f1200-a57f-424e-b995-7be160203c13","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"},"time":"2023-05-26T20:56:33.754957\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13"}] +[{"id":"d8485d98-0337-43d1-ae55-2996cdff239f","source":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13","type":"Microsoft.Communication.PlayCompleted","data":{"resultInformation":{"code":200,"subCode":0,"message":"Action completed successfully."},"callConnectionId":"401f1200-a57f-424e-b995-7be160203c13","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"},"time":"2023-05-26T20:57:27.6677654\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13"}] +[{"id":"db9243a1-6ec2-4648-bd65-a9dee6fe0cf3","source":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13","type":"Microsoft.Communication.CallDisconnected","data":{"callConnectionId":"401f1200-a57f-424e-b995-7be160203c13","serverCallId":"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtZXVuby0wMS5jb252LnNreXBlLmNvbS9jb252L01SbkFGaGpmc2t5WkZQWUtRbG9vLXc/aT0wJmU9NjM4MjA2NTQ3NTE3MzQxMDc0","correlationId":"64364cfa-9746-46cb-ab1c-b9864a011fde"},"time":"2023-05-26T20:57:55.1260789\u002B00:00","specversion":"1.0","datacontenttype":"application/json","subject":"calling/callConnections/401f1200-a57f-424e-b995-7be160203c13"}] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py index 098c7b55354e..c7fc7de1875a 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client.py @@ -47,12 +47,12 @@ def setUp(self): def test_play(self): mock_play = Mock() self.call_media_operations.play = mock_play - play_source = [FileSource(url=self.url)] + play_sources = [FileSource(url=self.url)] - self.call_connection_client.play_media(play_source=play_source, play_to=[self.target_user]) + self.call_connection_client.play_media(play_sources=play_sources, play_to=[self.target_user]) expected_play_request = PlayRequest( - play_sources=[x._to_generated() for x in play_source], + play_sources=[x._to_generated() for x in play_sources], play_to=[serialize_identifier(self.target_user)], play_options=PlayOptions(loop=False) ) @@ -68,12 +68,12 @@ def test_play(self): def test_play_to_all(self): mock_play = Mock() self.call_media_operations.play = mock_play - play_source = [FileSource(url=self.url)] + play_sources = [FileSource(url=self.url)] - self.call_connection_client.play_media_to_all(play_source=play_source) + self.call_connection_client.play_media_to_all(play_sources=play_sources) expected_play_request = PlayRequest( - play_sources=[x._to_generated() for x in play_source], + play_sources=[x._to_generated() for x in play_sources], play_to=[], play_options=PlayOptions(loop=False) ) diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py index 8e84033d42e7..fa0ea3036257 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_e2e.py @@ -42,8 +42,8 @@ async def test_play_media_in_a_call(self): print('TEST SCENARIO: _play_media_in_a_call') caller = self.identity_client.create_user() target = self.identity_client.create_user() - call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source_identity=caller) # for creating call - call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source_identity=target) # answering call, all other actions + call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source=caller) # for creating call + call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source=target) # answering call, all other actions unique_id = self.service_bus_with_new_call(caller, target) # create a call @@ -94,10 +94,10 @@ async def test_play_media_in_a_call(self): # play media to all participants caller_call_connection = CallConnectionClient.from_connection_string(self.connection_str, create_call_result.call_connection_id) - file_source = [FileSource(url=play_source_uri)] + file_source = FileSource(url=play_source_uri) caller_call_connection.play_media_to_all( - play_source=file_source, + play_sources=[file_source] ) # check for PlayCompleted event diff --git a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py index 2fea2a80ca0e..f988fcf305b1 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_e2e.py @@ -41,8 +41,8 @@ async def test_create_VOIP_call_and_answer_then_hangup(self): print('TEST SCENARIO: _create_VOIP_call_and_answer_then_hangup') caller = self.identity_client.create_user() target = self.identity_client.create_user() - call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source_identity=caller) # for creating call - call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source_identity=target) # answering call, all other actions + call_automation_client_caller = CallAutomationClient.from_connection_string(self.connection_str, source=caller) # for creating call + call_automation_client_target = CallAutomationClient.from_connection_string(self.connection_str, source=target) # answering call, all other actions unique_id = self.service_bus_with_new_call(caller, target) # create a call From a02f7970ab07f214f8366dd780c7c95da2b3fa59 Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Fri, 26 May 2023 15:27:11 -0700 Subject: [PATCH 5/8] remove unecessary whitespaces and imports --- .../communication/callautomation/_call_automation_client.py | 4 ++-- .../azure/communication/callautomation/_models.py | 2 +- .../callautomation/aio/_call_automation_client_async.py | 2 +- .../callautomation/aio/_call_connection_client_async.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py index 46851b780b4c..5c73a6a96cad 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import List, Union, Optional, TYPE_CHECKING, Iterable, Dict +from typing import List, Union, Optional, TYPE_CHECKING, Iterable from urllib.parse import urlparse from azure.core.tracing.decorator import distributed_trace from ._version import SDK_MONIKER @@ -93,7 +93,7 @@ def __init__( parsed_url = urlparse(endpoint.rstrip('/')) if not parsed_url.netloc: raise ValueError(f"Invalid URL: {format(endpoint)}") - + self._client = AzureCommunicationCallAutomationService( endpoint, api_version=api_version or DEFAULT_VERSION, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py index a42b9d2fb69d..9e3985af7a92 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_models.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import List, Optional, Union, TYPE_CHECKING, Dict +from typing import List, Optional, Union, TYPE_CHECKING from ._generated.models import ( CallLocator, FileSource as FileSourceInternal, diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py index 3785ece86a28..a1affe046b0e 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import List, Union, Optional, TYPE_CHECKING, AsyncIterable, Dict +from typing import List, Union, Optional, TYPE_CHECKING, AsyncIterable from urllib.parse import urlparse from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py index 195e0c7b8b55..47167282b5c4 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING, Optional, List, Union, Dict +from typing import TYPE_CHECKING, Optional, List, Union from urllib.parse import urlparse from azure.core.async_paging import AsyncItemPaged from azure.core.tracing.decorator import distributed_trace @@ -104,7 +104,7 @@ def __init__(# pylint: disable=missing-client-constructor-parameter-credential, **kwargs) else: self._client = call_automation_client - + self._call_connection_id = call_connection_id self._call_connection_client = self._client.call_connection self._call_media_client = self._client.call_media From 228a00ac13eb7a9b632d22d4bd1d7ae84a75b959 Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Fri, 26 May 2023 16:24:41 -0700 Subject: [PATCH 6/8] add service bus dependency to requirements.txt file --- .../azure-communication-callautomation/dev_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/communication/azure-communication-callautomation/dev_requirements.txt b/sdk/communication/azure-communication-callautomation/dev_requirements.txt index 798d5914eb22..c012bdc7c355 100644 --- a/sdk/communication/azure-communication-callautomation/dev_requirements.txt +++ b/sdk/communication/azure-communication-callautomation/dev_requirements.txt @@ -2,5 +2,6 @@ -e ../../identity/azure-identity -e ../azure-communication-identity -e ../../../tools/azure-devtools +-e ../../../servicebus/azure-servicebus ../../core/azure-core aiohttp>=3.0 \ No newline at end of file From 1e53eba1c92f444900b341cd8c3533e942575897 Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Fri, 26 May 2023 16:28:13 -0700 Subject: [PATCH 7/8] remove unused dict import --- .../communication/callautomation/_call_connection_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py index 8051c2473757..8bd9ccc99901 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING, Optional, List, Union, Dict +from typing import TYPE_CHECKING, Optional, List, Union from urllib.parse import urlparse from azure.core.paging import ItemPaged from azure.core.tracing.decorator import distributed_trace From 2d978d68b799e3e55a996b348ba9647f940b58f7 Mon Sep 17 00:00:00 2001 From: Adam Tazi Date: Fri, 26 May 2023 17:00:18 -0700 Subject: [PATCH 8/8] fix service bus path in dev_requirements.txt --- .../azure-communication-callautomation/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/azure-communication-callautomation/dev_requirements.txt b/sdk/communication/azure-communication-callautomation/dev_requirements.txt index c012bdc7c355..a1249ffd527f 100644 --- a/sdk/communication/azure-communication-callautomation/dev_requirements.txt +++ b/sdk/communication/azure-communication-callautomation/dev_requirements.txt @@ -2,6 +2,6 @@ -e ../../identity/azure-identity -e ../azure-communication-identity -e ../../../tools/azure-devtools --e ../../../servicebus/azure-servicebus +-e ../../servicebus/azure-servicebus ../../core/azure-core aiohttp>=3.0 \ No newline at end of file