From 13bc851feca3a4ff52353fd0fbe5795e7adaacce Mon Sep 17 00:00:00 2001 From: Vinothini Dharmaraj Date: Thu, 12 Feb 2026 14:20:25 -0800 Subject: [PATCH] ga7 changes --- .../CHANGELOG.md | 8 + .../callautomation/_api_versions.py | 3 +- .../callautomation/_call_connection_client.py | 53 +- .../callautomation/_generated/_client.py | 6 +- .../_generated/_configuration.py | 6 +- .../_generated/_utils/serialization.py | 43 +- .../callautomation/_generated/aio/_client.py | 6 +- .../_generated/aio/_configuration.py | 6 +- .../_generated/aio/operations/_operations.py | 300 ++- .../_generated/models/__init__.py | 18 + .../_generated/models/_enums.py | 47 +- .../_generated/models/_models.py | 1664 ++++++++++++----- .../_generated/operations/_operations.py | 400 +++- .../communication/callautomation/_models.py | 234 ++- .../communication/callautomation/_version.py | 2 +- .../aio/_call_connection_client_async.py | 53 +- .../swagger/SWAGGER.md | 4 +- 17 files changed, 2185 insertions(+), 668 deletions(-) diff --git a/sdk/communication/azure-communication-callautomation/CHANGELOG.md b/sdk/communication/azure-communication-callautomation/CHANGELOG.md index 0b61ad1a1a89..149cc6c2b099 100644 --- a/sdk/communication/azure-communication-callautomation/CHANGELOG.md +++ b/sdk/communication/azure-communication-callautomation/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.6.0 (Unreleased) + +### Features Added + +- Added support for moving a participant from one call to another, enabling seamless participant transfer between active calls. +- Added support for retrieving Teams phone call details, including the ability to specify a custom calling context for enhanced integration scenarios. +- Added Incomingcall event to support incoming call notification for Teams multipersona users + ## 1.5.0 (2025-09-10) ### Features Added 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 a5b857058fb2..cd6adafc7190 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 @@ -14,6 +14,7 @@ class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): V2024_09_15 = "2024-09-15" V2025_05_15 = "2025-05-15" V2025_06_15 = "2025-06-15" + V2026_03_12 = "2026-03-12" -DEFAULT_VERSION = ApiVersion.V2025_06_15.value +DEFAULT_VERSION = ApiVersion.V2026_03_12.value 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 12045d57ded1..3f37fda66f02 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines, disable=line-too-long, disable=too-many-locals # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -30,6 +30,8 @@ FileSource, TextSource, SsmlSource, + MoveParticipantsResult, + TeamsPhoneCallDetails, ) from ._generated._client import AzureCommunicationCallAutomationService from ._generated.models import ( @@ -56,6 +58,7 @@ UnholdRequest, StartMediaStreamingRequest, StopMediaStreamingRequest, + MoveParticipantsRequest, ) from ._generated.models._enums import RecognizeInputType from ._shared.auth_policy_utils import get_authentication_policy @@ -232,6 +235,7 @@ def transfer_call_to_participant( sip_headers: Optional[Mapping[str, str]] = None, voip_headers: Optional[Mapping[str, str]] = None, source_caller_id_number: Optional["PhoneNumberIdentifier"] = None, + teams_phone_call_details: Optional[TeamsPhoneCallDetails] = None, **kwargs, ) -> TransferCallResult: """Transfer this call to another participant. @@ -254,6 +258,8 @@ def transfer_call_to_participant( :keyword source_caller_id_number: The source caller Id, a phone number, that's will be used as the transferor's(Contoso) caller id when transfering a call a pstn target. :paramtype source_caller_id_number: ~azure.communication.callautomation.PhoneNumberIdentifier or None + :keyword teams_phone_call_details: Teams phone call details for the participant being added. + :paramtype teams_phone_call_details: ~azure.communication.callautomation.TeamsPhoneCallDetails or None :return: TransferCallResult :rtype: ~azure.communication.callautomation.TransferCallResult :raises ~azure.core.exceptions.HttpResponseError: @@ -262,6 +268,7 @@ def transfer_call_to_participant( user_custom_context: Optional[CustomCallingContext] = CustomCallingContext( voip_headers=dict(voip_headers) if voip_headers is not None else None, sip_headers=dict(sip_headers) if sip_headers is not None else None, + teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None, # pylint:disable=protected-access ) else: user_custom_context = None @@ -291,6 +298,7 @@ def add_participant( operation_callback_url: Optional[str] = None, sip_headers: Optional[Mapping[str, str]] = None, voip_headers: Optional[Mapping[str, str]] = None, + teams_phone_call_details: Optional[TeamsPhoneCallDetails] = None, **kwargs, ) -> AddParticipantResult: """Add a participant to this call. @@ -317,6 +325,8 @@ def add_participant( :paramtype sip_headers: Dict[str, str] or None :keyword voip_headers: Voip Headers for Voip Call :paramtype voip_headers: Dict[str, str] or None + :keyword teams_phone_call_details: Teams phone call details for the participant being added. + :paramtype teams_phone_call_details: ~azure.communication.callautomation.TeamsPhoneCallDetails or None :return: AddParticipantResult :rtype: ~azure.communication.callautomation.AddParticipantResult :raises ~azure.core.exceptions.HttpResponseError: @@ -331,6 +341,7 @@ def add_participant( user_custom_context: Optional[CustomCallingContext] = CustomCallingContext( voip_headers=dict(voip_headers) if voip_headers is not None else None, sip_headers=dict(sip_headers) if sip_headers is not None else None, + teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None, # pylint:disable=protected-access ) else: user_custom_context = None @@ -385,6 +396,46 @@ def remove_participant( return RemoveParticipantResult._from_generated(response) # pylint:disable=protected-access + @distributed_trace + def move_participants( + self, + target_participants: Sequence["CommunicationIdentifier"], + from_call: str, + *, + operation_context: Optional[str] = None, + operation_callback_url: Optional[str] = None, + **kwargs, + ) -> MoveParticipantsResult: + """Move participants from another call to this call. + + :param target_participants: The participants to move to this call. + :type target_participants: list[~azure.communication.callautomation.CommunicationIdentifier] + :param from_call: The CallConnectionId for the call you want to move the participant from. + :type from_call: str + :keyword operation_context: Value that can be used to track this call and its associated events. + :paramtype operation_context: str + :keyword operation_callback_url: Set a callback URL that overrides the default callback URL set + by CreateCall/AnswerCall for this operation. + This setup is per-action. If this is not set, the default callback URL set by + CreateCall/AnswerCall will be used. + :paramtype operation_callback_url: str or None + :return: MoveParticipantsResult + :rtype: ~azure.communication.callautomation.MoveParticipantsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + move_participants_request = MoveParticipantsRequest( + target_participants=[serialize_identifier(p) for p in target_participants], + from_call=from_call, + operation_context=operation_context, + operation_callback_uri=operation_callback_url, + ) + process_repeatability_first_sent(kwargs) + response = self._call_connection_client.move_participants( + self._call_connection_id, move_participants_request, **kwargs + ) + + return MoveParticipantsResult._from_generated(response) # pylint:disable=protected-access + @overload def play_media( self, 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 a313fe91e337..1d975a8180cb 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 @@ -36,11 +36,11 @@ class AzureCommunicationCallAutomationService(_AzureCommunicationCallAutomationS :vartype call_media: azure.communication.callautomation.operations.CallMediaOperations :ivar call_recording: CallRecordingOperations operations :vartype call_recording: azure.communication.callautomation.operations.CallRecordingOperations - :param endpoint: The endpoint of the Azure Communication resource. Required. + :param endpoint: The endpoint of the Azure Communication Service resource. Required. :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: Api Version. Default value is "2025-06-15". Note that overriding this + :keyword api_version: Api Version. Default value is "2026-03-12". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -71,7 +71,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) 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)}) + client_models |= {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 b693a68750bc..afaeb2cff160 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 @@ -21,17 +21,17 @@ class AzureCommunicationCallAutomationServiceConfiguration: # pylint: disable=t Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: The endpoint of the Azure Communication resource. Required. + :param endpoint: The endpoint of the Azure Communication Service resource. Required. :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: Api Version. Default value is "2025-06-15". Note that overriding this + :keyword api_version: Api Version. Default value is "2026-03-12". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-06-15") + api_version: str = kwargs.pop("api_version", "2026-03-12") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py index f5187701d7be..6da830e0cf4a 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -229,12 +227,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1184,7 +1189,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1391,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1759,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): 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 9cff92c52bbd..623f4298f253 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 @@ -37,11 +37,11 @@ class AzureCommunicationCallAutomationService(_AzureCommunicationCallAutomationS :ivar call_recording: CallRecordingOperations operations :vartype call_recording: azure.communication.callautomation.aio.operations.CallRecordingOperations - :param endpoint: The endpoint of the Azure Communication resource. Required. + :param endpoint: The endpoint of the Azure Communication Service resource. Required. :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: Api Version. Default value is "2025-06-15". Note that overriding this + :keyword api_version: Api Version. Default value is "2026-03-12". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -72,7 +72,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) 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)}) + client_models |= {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 de3ff7009e0d..52a0a677f9c6 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 @@ -21,17 +21,17 @@ class AzureCommunicationCallAutomationServiceConfiguration: # pylint: disable=t Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: The endpoint of the Azure Communication resource. Required. + :param endpoint: The endpoint of the Azure Communication Service resource. Required. :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: Api Version. Default value is "2025-06-15". Note that overriding this + :keyword api_version: Api Version. Default value is "2026-03-12". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-06-15") + api_version: str = kwargs.pop("api_version", "2026-03-12") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") 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 37f462e39a6e..2fa3e4a957ea 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 @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -42,6 +42,7 @@ build_call_connection_get_participant_request, build_call_connection_get_participants_request, build_call_connection_hangup_call_request, + build_call_connection_move_participants_request, build_call_connection_mute_request, build_call_connection_remove_participant_request, build_call_connection_terminate_call_request, @@ -68,7 +69,7 @@ from .._configuration import AzureCommunicationCallAutomationServiceConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] class _AzureCommunicationCallAutomationServiceOperationsMixin( @@ -173,7 +174,10 @@ async def create_call( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -279,7 +283,10 @@ async def answer_call( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -389,7 +396,10 @@ async def redirect_call( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -491,7 +501,10 @@ async def reject_call( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -592,7 +605,10 @@ async def connect( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -669,7 +685,10 @@ async def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.Call 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -726,7 +745,10 @@ async def hangup_call(self, call_connection_id: str, **kwargs: Any) -> None: if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -777,7 +799,10 @@ async def terminate_call(self, call_connection_id: str, **kwargs: Any) -> None: if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -900,7 +925,10 @@ async def transfer_to_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("TransferCallResponse", pipeline_response.http_response) @@ -994,7 +1022,10 @@ async def get_next(next_link=None): 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -1117,7 +1148,10 @@ async def add_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("AddParticipantResponse", pipeline_response.http_response) @@ -1244,7 +1278,10 @@ async def remove_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RemoveParticipantResponse", pipeline_response.http_response) @@ -1371,7 +1408,10 @@ async def mute( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("MuteParticipantsResult", pipeline_response.http_response) @@ -1498,7 +1538,10 @@ async def cancel_add_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CancelAddParticipantResponse", pipeline_response.http_response) @@ -1508,6 +1551,136 @@ async def cancel_add_participant( return deserialized # type: ignore + @overload + async def move_participants( + self, + call_connection_id: str, + move_participant_request: _models.MoveParticipantsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Required. + :type move_participant_request: + ~azure.communication.callautomation.models.MoveParticipantsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def move_participants( + self, + call_connection_id: str, + move_participant_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Required. + :type move_participant_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def move_participants( + self, + call_connection_id: str, + move_participant_request: Union[_models.MoveParticipantsRequest, IO[bytes]], + **kwargs: Any + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Is either a + MoveParticipantsRequest type or a IO[bytes] type. Required. + :type move_participant_request: + ~azure.communication.callautomation.models.MoveParticipantsRequest or IO[bytes] + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.MoveParticipantsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move_participant_request, (IOBase, bytes)): + _content = move_participant_request + else: + _json = self._serialize.body(move_participant_request, "MoveParticipantsRequest") + + _request = build_call_connection_move_participants_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) + + deserialized = self._deserialize("MoveParticipantsResponse", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace_async async def get_participant( self, call_connection_id: str, participant_raw_id: str, **kwargs: Any @@ -1558,7 +1731,10 @@ async def get_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallParticipant", pipeline_response.http_response) @@ -1697,7 +1873,10 @@ async def play( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1820,7 +1999,10 @@ async def start_transcription( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1943,7 +2125,10 @@ async def stop_transcription( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2066,7 +2251,10 @@ async def update_transcription( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2117,7 +2305,10 @@ async def cancel_all_media_operations(self, call_connection_id: str, **kwargs: A 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2236,7 +2427,10 @@ async def recognize( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2359,7 +2553,10 @@ async def start_continuous_dtmf_recognition( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2482,7 +2679,10 @@ async def stop_continuous_dtmf_recognition( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2604,7 +2804,10 @@ async def send_dtmf_tones( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("SendDtmfTonesResult", pipeline_response.http_response) @@ -2721,7 +2924,10 @@ async def hold( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2839,7 +3045,10 @@ async def unhold( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2962,7 +3171,10 @@ async def start_media_streaming( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3085,7 +3297,10 @@ async def stop_media_streaming( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3214,7 +3429,10 @@ async def start_recording( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RecordingStateResponse", pipeline_response.http_response) @@ -3269,7 +3487,10 @@ async def get_recording_properties(self, recording_id: str, **kwargs: Any) -> _m 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RecordingStateResponse", pipeline_response.http_response) @@ -3324,7 +3545,10 @@ async def stop_recording(self, recording_id: str, **kwargs: Any) -> None: if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3375,7 +3599,10 @@ async def pause_recording(self, recording_id: str, **kwargs: Any) -> None: 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3426,7 +3653,10 @@ async def resume_recording(self, recording_id: str, **kwargs: Any) -> None: 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: 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 8102d9796c5f..96692b933d50 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 @@ -54,6 +54,7 @@ FileSource, HoldFailed, HoldRequest, + IncomingCall, MediaStreamingFailed, MediaStreamingOptions, MediaStreamingStarted, @@ -62,6 +63,10 @@ MediaStreamingUpdate, MicrosoftTeamsAppIdentifierModel, MicrosoftTeamsUserIdentifierModel, + MoveParticipantFailed, + MoveParticipantSucceeded, + MoveParticipantsRequest, + MoveParticipantsResponse, MuteParticipantsRequest, MuteParticipantsResult, ParticipantsUpdated, @@ -91,6 +96,7 @@ SendDtmfTonesFailed, SendDtmfTonesRequest, SendDtmfTonesResult, + SipDiagnosticInfo, SpeechOptions, SpeechResult, SsmlSource, @@ -101,6 +107,9 @@ StopMediaStreamingRequest, StopTranscriptionRequest, TeamsExtensionUserIdentifierModel, + TeamsPhoneCallDetails, + TeamsPhoneCallerDetails, + TeamsPhoneSourceDetails, TextSource, TranscriptionFailed, TranscriptionOptions, @@ -191,6 +200,7 @@ "FileSource", "HoldFailed", "HoldRequest", + "IncomingCall", "MediaStreamingFailed", "MediaStreamingOptions", "MediaStreamingStarted", @@ -199,6 +209,10 @@ "MediaStreamingUpdate", "MicrosoftTeamsAppIdentifierModel", "MicrosoftTeamsUserIdentifierModel", + "MoveParticipantFailed", + "MoveParticipantSucceeded", + "MoveParticipantsRequest", + "MoveParticipantsResponse", "MuteParticipantsRequest", "MuteParticipantsResult", "ParticipantsUpdated", @@ -228,6 +242,7 @@ "SendDtmfTonesFailed", "SendDtmfTonesRequest", "SendDtmfTonesResult", + "SipDiagnosticInfo", "SpeechOptions", "SpeechResult", "SsmlSource", @@ -238,6 +253,9 @@ "StopMediaStreamingRequest", "StopTranscriptionRequest", "TeamsExtensionUserIdentifierModel", + "TeamsPhoneCallDetails", + "TeamsPhoneCallerDetails", + "TeamsPhoneSourceDetails", "TextSource", "TranscriptionFailed", "TranscriptionOptions", 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 1f0914fb266d..1e6a425752cd 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 @@ -11,16 +11,14 @@ class AudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The audio format used for encoding, including sample rate and channel type. The default is - Pcm16KMono. - """ + """The format of the audio received from the audio subscription option.""" PCM16_K_MONO = "pcm16KMono" PCM24_K_MONO = "pcm24KMono" class CallConnectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The state of the call connection.""" + """The states of a call connection.""" UNKNOWN = "unknown" CONNECTING = "connecting" @@ -40,7 +38,7 @@ class CallLocatorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CallRejectReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The rejection reason.""" + """Reason of rejecting a call.""" NONE = "none" BUSY = "busy" @@ -67,7 +65,7 @@ class CommunicationIdentifierModelKind(str, Enum, metaclass=CaseInsensitiveEnumM class DtmfTone(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DtmfTone.""" + """List of valid stop tones.""" ZERO = "zero" ONE = "one" @@ -95,7 +93,7 @@ class MediaStreamingAudioChannelType(str, Enum, metaclass=CaseInsensitiveEnumMet class MediaStreamingContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """MediaStreamingContentType.""" + """Type of content in Media streaming.""" AUDIO = "audio" @@ -130,7 +128,7 @@ class MediaStreamingStatusDetails(str, Enum, metaclass=CaseInsensitiveEnumMeta): class MediaStreamingSubscriptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media streaming subscription state.""" + """Current state of media streaming session.""" DISABLED = "disabled" INACTIVE = "inactive" @@ -138,7 +136,7 @@ class MediaStreamingSubscriptionState(str, Enum, metaclass=CaseInsensitiveEnumMe class PlaySourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines the type of the play source.""" + """Defines the types of play source.""" FILE = "file" TEXT = "text" @@ -146,8 +144,8 @@ class PlaySourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecognitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines the sub-type of the recognize operation. - In case of cancel operation the this field is not set and is returned empty. + """Recognition type determines the sub-type of the recognition operation Possible values will be + Dtmf, Speech, or Choices. """ DTMF = "dtmf" @@ -156,7 +154,7 @@ class RecognitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecognizeInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines the type of the recognition.""" + """Defines the type of the recognize input.""" DTMF = "dtmf" SPEECH = "speech" @@ -165,7 +163,7 @@ class RecognizeInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecordingChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The channel type of call recording.""" + """Defines the channel type of call recording.""" MIXED = "mixed" UNMIXED = "unmixed" @@ -179,7 +177,7 @@ class RecordingContent(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecordingFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format type of call recording.""" + """Defines the format type of call recording.""" WAV = "wav" MP3 = "mp3" @@ -189,12 +187,9 @@ class RecordingFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecordingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RecordingKind.""" - AZURE_COMMUNICATION_SERVICES = "AzureCommunicationServices" - """Recording initiated by Azure Communication Services""" - TEAMS = "Teams" - """Recording initiated by Teams user""" - TEAMS_COMPLIANCE = "TeamsCompliance" - """Recording initiated by Teams compliance policy""" + AZURE_COMMUNICATION_SERVICES = "azureCommunicationServices" + TEAMS = "teams" + TEAMS_COMPLIANCE = "teamsCompliance" class RecordingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -207,10 +202,8 @@ class RecordingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RecordingStorageKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the kind of external storage.""" - AZURE_COMMUNICATION_SERVICES = "AzureCommunicationServices" - """Storage managed by Azure Communication Services""" - AZURE_BLOB_STORAGE = "AzureBlobStorage" - """Storage managed by provided Azure blob""" + AZURE_COMMUNICATION_SERVICES = "azureCommunicationServices" + AZURE_BLOB_STORAGE = "azureBlobStorage" class StreamingTransportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -222,7 +215,7 @@ class StreamingTransportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class TranscriptionResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """TranscriptionResultType.""" + """Transcription result types.""" FINAL = "final" INTERMEDIATE = "intermediate" @@ -260,7 +253,7 @@ class TranscriptionStatusDetails(str, Enum, metaclass=CaseInsensitiveEnumMeta): class TranscriptionSubscriptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Transcription subscription state.""" + """Current state of transcription session.""" DISABLED = "disabled" INACTIVE = "inactive" @@ -268,7 +261,7 @@ class TranscriptionSubscriptionState(str, Enum, metaclass=CaseInsensitiveEnumMet class VoiceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Voice kind type.""" + """Audio kind type.""" MALE = "male" FEMALE = "female" 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 6d3bd9bccb26..6a2ad19f8ea9 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 @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Optional, TYPE_CHECKING, Union from .._utils import serialization as _serialization @@ -29,9 +29,12 @@ 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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. + :ivar participant: 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. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -66,9 +69,12 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. + :keyword participant: 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. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -85,31 +91,30 @@ class AddParticipantRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar source_caller_id_number: The source caller Id, a phone number, that's shown to the PSTN - participant being invited. - Required only when inviting a PSTN participant. + :ivar source_caller_id_number: A phone number. :vartype source_caller_id_number: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel :ivar source_display_name: (Optional) The display name of the source that is associated with - this invite operation when - adding a PSTN participant or teams user. Note: Will not update the display name in the roster. + this invite operation when adding a PSTN participant or teams user. Note: Will not update the + display name in the roster. :vartype source_display_name: str - :ivar participant_to_add: The participant to invite. Required. + :ivar participant_to_add: 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. Required. :vartype participant_to_add: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar invitation_timeout_in_seconds: Gets or sets the timeout to wait for the invited - participant to pickup. - The maximum value of this is 180 seconds. + participant to pickup. The maximum value of this is 180 seconds. :vartype invitation_timeout_in_seconds: int :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str - :ivar custom_calling_context: Used by customer to send custom calling context to targets. + :ivar custom_calling_context: The custom calling context which will be sent to the target. :vartype custom_calling_context: ~azure.communication.callautomation.models.CustomCallingContext """ @@ -142,31 +147,30 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword source_caller_id_number: The source caller Id, a phone number, that's shown to the - PSTN participant being invited. - Required only when inviting a PSTN participant. + :keyword source_caller_id_number: A phone number. :paramtype source_caller_id_number: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel :keyword source_display_name: (Optional) The display name of the source that is associated with - this invite operation when - adding a PSTN participant or teams user. Note: Will not update the display name in the roster. + this invite operation when adding a PSTN participant or teams user. Note: Will not update the + display name in the roster. :paramtype source_display_name: str - :keyword participant_to_add: The participant to invite. Required. + :keyword participant_to_add: 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. Required. :paramtype participant_to_add: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword invitation_timeout_in_seconds: Gets or sets the timeout to wait for the invited - participant to pickup. - The maximum value of this is 180 seconds. + participant to pickup. The maximum value of this is 180 seconds. :paramtype invitation_timeout_in_seconds: int :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str - :keyword custom_calling_context: Used by customer to send custom calling context to targets. + :keyword custom_calling_context: The custom calling context which will be sent to the target. :paramtype custom_calling_context: ~azure.communication.callautomation.models.CustomCallingContext """ @@ -183,7 +187,7 @@ def __init__( class AddParticipantResponse(_serialization.Model): """The response payload for adding participants to the call. - :ivar participant: List of current participants in the call. + :ivar participant: A call participant. :vartype participant: ~azure.communication.callautomation.models.CallParticipant :ivar operation_context: The operation context provided by client. :vartype operation_context: str @@ -206,7 +210,7 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword participant: List of current participants in the call. + :keyword participant: A call participant. :paramtype participant: ~azure.communication.callautomation.models.CallParticipant :keyword operation_context: The operation context provided by client. :paramtype operation_context: str @@ -232,9 +236,12 @@ 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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. + :ivar participant: 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. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -269,9 +276,12 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. + :keyword participant: 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. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -297,13 +307,13 @@ class AnswerCallRequest(_serialization.Model): :ivar call_intelligence_options: AI options for the call. :vartype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :ivar answered_by: The identifier of the call automation entity which answers the call. + :ivar answered_by: A user that got created with an Azure Communication Services resource. :vartype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :ivar media_streaming_options: Media Streaming Options. + :ivar media_streaming_options: Options for media streaming. :vartype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :ivar transcription_options: Transcription Options. + :ivar transcription_options: Options for live transcription. :vartype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions """ @@ -344,13 +354,13 @@ def __init__( :keyword call_intelligence_options: AI options for the call. :paramtype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :keyword answered_by: The identifier of the call automation entity which answers the call. + :keyword answered_by: A user that got created with an Azure Communication Services resource. :paramtype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :keyword media_streaming_options: Media Streaming Options. + :keyword media_streaming_options: Options for media streaming. :paramtype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :keyword transcription_options: Transcription Options. + :keyword transcription_options: Options for live transcription. :paramtype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions """ @@ -377,7 +387,7 @@ class AnswerFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -410,7 +420,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -434,7 +444,7 @@ class CallConnected(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -467,7 +477,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -487,36 +497,34 @@ class CallConnectionProperties(_serialization.Model): :vartype server_call_id: str :ivar targets: The targets of the call. :vartype targets: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar call_connection_state: The state of the call connection. Known values are: "unknown", + :ivar call_connection_state: The states of a call connection. Known values are: "unknown", "connecting", "connected", "transferring", "transferAccepted", "disconnecting", and "disconnected". :vartype call_connection_state: str or ~azure.communication.callautomation.models.CallConnectionState :ivar callback_uri: The callback URI. :vartype callback_uri: 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. + :ivar source_caller_id_number: A phone number. :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: Source identity. + :ivar source: 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. :vartype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar correlation_id: The correlation ID. :vartype correlation_id: str - :ivar answered_by: Identity of the answering entity. Only populated when identity is provided - in the request. + :ivar answered_by: A user that got created with an Azure Communication Services resource. :vartype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :ivar media_streaming_subscription: The state of media streaming subscription for the call. + :ivar media_streaming_subscription: Media streaming Subscription Object. :vartype media_streaming_subscription: ~azure.communication.callautomation.models.MediaStreamingSubscription - :ivar transcription_subscription: Transcription Subscription. + :ivar transcription_subscription: Transcription Subscription Object. :vartype transcription_subscription: ~azure.communication.callautomation.models.TranscriptionSubscription - :ivar answered_for: Identity of the original Pstn target of an incoming Call. Only populated - when the original target is a Pstn number. + :ivar answered_for: A phone number. :vartype answered_for: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel """ @@ -541,7 +549,7 @@ def __init__( *, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, - targets: Optional[List["_models.CommunicationIdentifierModel"]] = None, + targets: Optional[list["_models.CommunicationIdentifierModel"]] = None, call_connection_state: Optional[Union[str, "_models.CallConnectionState"]] = None, callback_uri: Optional[str] = None, source_caller_id_number: Optional["_models.PhoneNumberIdentifierModel"] = None, @@ -562,36 +570,35 @@ def __init__( :keyword targets: The targets of the call. :paramtype targets: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :keyword call_connection_state: The state of the call connection. Known values are: "unknown", + :keyword call_connection_state: The states of a call connection. Known values are: "unknown", "connecting", "connected", "transferring", "transferAccepted", "disconnecting", and "disconnected". :paramtype call_connection_state: str or ~azure.communication.callautomation.models.CallConnectionState :keyword callback_uri: The callback URI. :paramtype callback_uri: 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. + :keyword source_caller_id_number: A phone number. :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: Source identity. + :keyword source: 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. :paramtype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword correlation_id: The correlation ID. :paramtype correlation_id: str - :keyword answered_by: Identity of the answering entity. Only populated when identity is - provided in the request. + :keyword answered_by: A user that got created with an Azure Communication Services resource. :paramtype answered_by: ~azure.communication.callautomation.models.CommunicationUserIdentifierModel - :keyword media_streaming_subscription: The state of media streaming subscription for the call. + :keyword media_streaming_subscription: Media streaming Subscription Object. :paramtype media_streaming_subscription: ~azure.communication.callautomation.models.MediaStreamingSubscription - :keyword transcription_subscription: Transcription Subscription. + :keyword transcription_subscription: Transcription Subscription Object. :paramtype transcription_subscription: ~azure.communication.callautomation.models.TranscriptionSubscription - :keyword answered_for: Identity of the original Pstn target of an incoming Call. Only populated - when the original target is a Pstn number. + :keyword answered_for: A phone number. :paramtype answered_for: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel """ super().__init__(**kwargs) @@ -623,7 +630,7 @@ class CallDisconnected(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -656,7 +663,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -740,7 +747,10 @@ def __init__( class CallParticipant(_serialization.Model): """A call participant. - :ivar identifier: Communication identifier of the participant. + :ivar identifier: 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. :vartype identifier: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar is_muted: Is participant muted. :vartype is_muted: bool @@ -763,7 +773,10 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword identifier: Communication identifier of the participant. + :keyword identifier: 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. :paramtype identifier: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword is_muted: Is participant muted. :paramtype is_muted: bool @@ -789,12 +802,18 @@ 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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar transfer_target: Target who the call is transferred to. + :ivar transfer_target: 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. :vartype transfer_target: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar transferee: the participant who is being transferred away. + :ivar transferee: 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. :vartype transferee: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -831,12 +850,18 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword transfer_target: Target who the call is transferred to. + :keyword transfer_target: 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. :paramtype transfer_target: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword transferee: the participant who is being transferred away. + :keyword transferee: 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. :paramtype transferee: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -862,7 +887,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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -895,7 +920,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -919,10 +944,10 @@ class CancelAddParticipantFailed(_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. - :vartype result_information: ~azure.communication.callautomation.models.ResultInformation :ivar invitation_id: Invitation ID used to cancel the request. :vartype invitation_id: str + :ivar result_information: + :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ _attribute_map = { @@ -930,8 +955,8 @@ class CancelAddParticipantFailed(_serialization.Model): "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"}, "invitation_id": {"key": "invitationId", "type": "str"}, + "result_information": {"key": "resultInformation", "type": "ResultInformation"}, } def __init__( @@ -941,8 +966,8 @@ def __init__( server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, operation_context: Optional[str] = None, - result_information: Optional["_models.ResultInformation"] = None, invitation_id: Optional[str] = None, + result_information: Optional["_models.ResultInformation"] = None, **kwargs: Any ) -> None: """ @@ -956,18 +981,18 @@ 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. - :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation :keyword invitation_id: Invitation ID used to cancel the request. :paramtype invitation_id: str + :keyword result_information: + :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 self.invitation_id = invitation_id + self.result_information = result_information class CancelAddParticipantRequest(_serialization.Model): @@ -981,9 +1006,8 @@ class CancelAddParticipantRequest(_serialization.Model): request to the response event. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -1012,9 +1036,8 @@ def __init__( request to the response event. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -1066,7 +1089,7 @@ class CancelAddParticipantSucceeded(_serialization.Model): :vartype operation_context: str :ivar invitation_id: Invitation ID used to cancel the request. :vartype invitation_id: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -1103,7 +1126,7 @@ def __init__( :paramtype operation_context: str :keyword invitation_id: Invitation ID used to cancel the request. :paramtype invitation_id: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -1122,9 +1145,10 @@ class ChannelAffinity(_serialization.Model): :ivar channel: Channel number to which bitstream from a particular participant will be written. :vartype channel: int - :ivar participant: The identifier for the participant whose bitstream will be written to the - channel - represented by the channel number. Required. + :ivar participant: 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. Required. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -1145,9 +1169,10 @@ def __init__( :keyword channel: Channel number to which bitstream from a particular participant will be written. :paramtype channel: int - :keyword participant: The identifier for the participant whose bitstream will be written to the - channel - represented by the channel number. Required. + :keyword participant: 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. Required. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -1164,8 +1189,8 @@ class Choice(_serialization.Model): :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". + :ivar tone: List of valid stop tones. 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 """ @@ -1181,15 +1206,15 @@ class Choice(_serialization.Model): } def __init__( - self, *, label: str, phrases: List[str], tone: Optional[Union[str, "_models.DtmfTone"]] = None, **kwargs: Any + 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". + :keyword tone: List of valid stop tones. 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) @@ -1204,9 +1229,8 @@ class ChoiceResult(_serialization.Model): :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. + 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 :ivar confidence: The confidence level of the recognized speech, if available, ranges from 0.0 to 1.0. @@ -1231,9 +1255,8 @@ def __init__( :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. + 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 :keyword confidence: The confidence level of the recognized speech, if available, ranges from 0.0 to 1.0. @@ -1291,7 +1314,7 @@ def __init__(self, *, code: str, message: str, **kwargs: Any) -> None: self.code = code self.message = message self.target: Optional[str] = None - self.details: Optional[List["_models.CommunicationError"]] = None + self.details: Optional[list["_models.CommunicationError"]] = None self.inner_error: Optional["_models.CommunicationError"] = None @@ -1443,7 +1466,7 @@ class ConnectFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -1476,7 +1499,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -1492,7 +1515,7 @@ class ConnectRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar call_locator: The call locator. Required. + :ivar call_locator: The locator used for joining or taking action on a call. Required. :vartype call_locator: ~azure.communication.callautomation.models.CallLocator :ivar callback_uri: The callback URI. Required. :vartype callback_uri: str @@ -1501,10 +1524,10 @@ class ConnectRequest(_serialization.Model): :ivar call_intelligence_options: AI options for the call. :vartype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :ivar media_streaming_options: Media Streaming Options. + :ivar media_streaming_options: Options for media streaming. :vartype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :ivar transcription_options: Transcription Options. + :ivar transcription_options: Options for live transcription. :vartype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions """ @@ -1534,7 +1557,7 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword call_locator: The call locator. Required. + :keyword call_locator: The locator used for joining or taking action on a call. Required. :paramtype call_locator: ~azure.communication.callautomation.models.CallLocator :keyword callback_uri: The callback URI. Required. :paramtype callback_uri: str @@ -1543,10 +1566,10 @@ def __init__( :keyword call_intelligence_options: AI options for the call. :paramtype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :keyword media_streaming_options: Media Streaming Options. + :keyword media_streaming_options: Options for media streaming. :paramtype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :keyword transcription_options: Transcription Options. + :keyword transcription_options: Options for live transcription. :paramtype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions """ @@ -1564,15 +1587,17 @@ class ContinuousDtmfRecognitionRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar target_participant: Defines options for recognition. Required. + :ivar target_participant: 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. Required. :vartype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -1595,15 +1620,17 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword target_participant: Defines options for recognition. Required. + :keyword target_participant: 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. Required. :paramtype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -1625,7 +1652,7 @@ class ContinuousDtmfRecognitionStopped(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -1658,7 +1685,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -1679,7 +1706,7 @@ class ContinuousDtmfRecognitionToneFailed(_serialization.Model): :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for skype chain ID. :vartype correlation_id: str - :ivar result_information: Contains the resulting SIP code, sub-code and message. + :ivar result_information: :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. @@ -1712,7 +1739,7 @@ def __init__( :keyword correlation_id: Correlation ID for event to call correlation. Also called ChainId for skype chain ID. :paramtype correlation_id: str - :keyword result_information: Contains the resulting SIP code, sub-code and message. + :keyword result_information: :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. @@ -1734,8 +1761,8 @@ class ContinuousDtmfRecognitionToneReceived(_serialization.Model): :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. :vartype sequence_id: int - :ivar tone: Known values are: "zero", "one", "two", "three", "four", "five", "six", "seven", - "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". + :ivar tone: List of valid stop tones. 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 :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -1747,7 +1774,7 @@ class ContinuousDtmfRecognitionToneReceived(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -1777,8 +1804,8 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword tone: Known values are: "zero", "one", "two", "three", "four", "five", "six", "seven", - "eight", "nine", "a", "b", "c", "d", "pound", and "asterisk". + :keyword tone: List of valid stop tones. 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 :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str @@ -1790,7 +1817,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -1816,7 +1843,7 @@ class CreateCallFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -1849,7 +1876,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -1867,14 +1894,12 @@ class CreateCallRequest(_serialization.Model): :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. + :ivar source_caller_id_number: A phone number. :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. + :ivar source: A user that got created with an Azure Communication Services resource. :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 @@ -1883,13 +1908,12 @@ class CreateCallRequest(_serialization.Model): :ivar call_intelligence_options: AI options for the call. :vartype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :ivar media_streaming_options: Media Streaming Options. + :ivar media_streaming_options: Options for media streaming. :vartype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :ivar transcription_options: Transcription Options. + :ivar transcription_options: Options for live transcription. :vartype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions - :ivar teams_app_source: The identifier of the source for creating call with Teams resource - account ID. + :ivar teams_app_source: A Microsoft Teams application. :vartype teams_app_source: ~azure.communication.callautomation.models.MicrosoftTeamsAppIdentifierModel """ @@ -1915,7 +1939,7 @@ class CreateCallRequest(_serialization.Model): def __init__( self, *, - targets: List["_models.CommunicationIdentifierModel"], + targets: list["_models.CommunicationIdentifierModel"], callback_uri: str, source_caller_id_number: Optional["_models.PhoneNumberIdentifierModel"] = None, source_display_name: Optional[str] = None, @@ -1931,14 +1955,12 @@ def __init__( :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. + :keyword source_caller_id_number: A phone number. :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. + :keyword source: A user that got created with an Azure Communication Services resource. :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 @@ -1947,14 +1969,13 @@ def __init__( :keyword call_intelligence_options: AI options for the call. :paramtype call_intelligence_options: ~azure.communication.callautomation.models.CallIntelligenceOptions - :keyword media_streaming_options: Media Streaming Options. + :keyword media_streaming_options: Options for media streaming. :paramtype media_streaming_options: ~azure.communication.callautomation.models.MediaStreamingOptions - :keyword transcription_options: Transcription Options. + :keyword transcription_options: Options for live transcription. :paramtype transcription_options: ~azure.communication.callautomation.models.TranscriptionOptions - :keyword teams_app_source: The identifier of the source for creating call with Teams resource - account ID. + :keyword teams_app_source: A Microsoft Teams application. :paramtype teams_app_source: ~azure.communication.callautomation.models.MicrosoftTeamsAppIdentifierModel """ @@ -1978,18 +1999,23 @@ class CustomCallingContext(_serialization.Model): :vartype voip_headers: dict[str, str] :ivar sip_headers: Custom calling context SIP headers. :vartype sip_headers: dict[str, str] + :ivar teams_phone_call_details: The call details which will be sent to the target. + :vartype teams_phone_call_details: + ~azure.communication.callautomation.models.TeamsPhoneCallDetails """ _attribute_map = { "voip_headers": {"key": "voipHeaders", "type": "{str}"}, "sip_headers": {"key": "sipHeaders", "type": "{str}"}, + "teams_phone_call_details": {"key": "teamsPhoneCallDetails", "type": "TeamsPhoneCallDetails"}, } def __init__( self, *, - voip_headers: Optional[Dict[str, str]] = None, - sip_headers: Optional[Dict[str, str]] = None, + voip_headers: Optional[dict[str, str]] = None, + sip_headers: Optional[dict[str, str]] = None, + teams_phone_call_details: Optional["_models.TeamsPhoneCallDetails"] = None, **kwargs: Any ) -> None: """ @@ -1997,10 +2023,14 @@ def __init__( :paramtype voip_headers: dict[str, str] :keyword sip_headers: Custom calling context SIP headers. :paramtype sip_headers: dict[str, str] + :keyword teams_phone_call_details: The call details which will be sent to the target. + :paramtype teams_phone_call_details: + ~azure.communication.callautomation.models.TeamsPhoneCallDetails """ super().__init__(**kwargs) self.voip_headers = voip_headers self.sip_headers = sip_headers + self.teams_phone_call_details = teams_phone_call_details class DtmfOptions(_serialization.Model): @@ -2029,7 +2059,7 @@ def __init__( *, inter_tone_timeout_in_seconds: Optional[int] = None, max_tones_to_collect: Optional[int] = None, - stop_tones: Optional[List[Union[str, "_models.DtmfTone"]]] = None, + stop_tones: Optional[list[Union[str, "_models.DtmfTone"]]] = None, **kwargs: Any ) -> None: """ @@ -2066,7 +2096,7 @@ class DtmfResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.tones: Optional[List[Union[str, "_models.DtmfTone"]]] = None + self.tones: Optional[list[Union[str, "_models.DtmfTone"]]] = None class ExternalStorage(_serialization.Model): @@ -2075,7 +2105,7 @@ class ExternalStorage(_serialization.Model): All required parameters must be populated in order to send to server. :ivar recording_storage_kind: Defines the kind of external storage. Required. Known values are: - "AzureCommunicationServices" and "AzureBlobStorage". + "azureCommunicationServices" and "azureBlobStorage". :vartype recording_storage_kind: str or ~azure.communication.callautomation.models.RecordingStorageKind :ivar recording_destination_container_url: Uri of a container or a location within a container. @@ -2100,7 +2130,7 @@ def __init__( ) -> None: """ :keyword recording_storage_kind: Defines the kind of external storage. Required. Known values - are: "AzureCommunicationServices" and "AzureBlobStorage". + are: "azureCommunicationServices" and "azureBlobStorage". :paramtype recording_storage_kind: str or ~azure.communication.callautomation.models.RecordingStorageKind :keyword recording_destination_container_url: Uri of a container or a location within a @@ -2159,7 +2189,7 @@ class GetParticipantsResponse(_serialization.Model): } def __init__( - self, *, value: List["_models.CallParticipant"], next_link: Optional[str] = None, **kwargs: Any + self, *, value: list["_models.CallParticipant"], next_link: Optional[str] = None, **kwargs: Any ) -> None: """ :keyword value: List of the current participants in the call. Required. @@ -2185,7 +2215,7 @@ class HoldFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -2218,7 +2248,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -2234,18 +2264,20 @@ class HoldRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar target_participant: Participant to be held from the call. Required. + :ivar target_participant: 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. Required. :vartype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :ivar play_source_info: Prompt to play while in hold. + :ivar play_source_info: :vartype play_source_info: ~azure.communication.callautomation.models.PlaySource :ivar operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -2270,18 +2302,20 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword target_participant: Participant to be held from the call. Required. + :keyword target_participant: 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. Required. :paramtype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel - :keyword play_source_info: Prompt to play while in hold. + :keyword play_source_info: :paramtype play_source_info: ~azure.communication.callautomation.models.PlaySource :keyword operation_context: Used by customers when calling mid-call actions to correlate the request to the response event. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -2291,13 +2325,101 @@ def __init__( self.operation_callback_uri = operation_callback_uri -class MediaStreamingFailed(_serialization.Model): - """MediaStreamingFailed. +class IncomingCall(_serialization.Model): + """The incoming call event. Variables are only populated by the server, and will be ignored when sending a request. - :ivar media_streaming_update: Defines the result for MediaStreamingUpdate with the current - status and the details about the status. + :ivar to: 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. + :vartype to: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar from_property: 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. + :vartype from_property: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar caller_display_name: Display name of caller. + :vartype caller_display_name: str + :ivar server_call_id: The server call id. + :vartype server_call_id: str + :ivar custom_context: The custom calling context which will be sent to the target. + :vartype custom_context: ~azure.communication.callautomation.models.CustomCallingContext + :ivar incoming_call_context: Incoming call context. + :vartype incoming_call_context: str + :ivar on_behalf_of_callee: 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. + :vartype on_behalf_of_callee: + ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar correlation_id: Correlation ID for event to call correlation. Also called ChainId for + skype chain ID. + :vartype correlation_id: str + """ + + _validation = { + "caller_display_name": {"readonly": True}, + "server_call_id": {"readonly": True}, + "incoming_call_context": {"readonly": True}, + "correlation_id": {"readonly": True}, + } + + _attribute_map = { + "to": {"key": "to", "type": "CommunicationIdentifierModel"}, + "from_property": {"key": "from", "type": "CommunicationIdentifierModel"}, + "caller_display_name": {"key": "callerDisplayName", "type": "str"}, + "server_call_id": {"key": "serverCallId", "type": "str"}, + "custom_context": {"key": "customContext", "type": "CustomCallingContext"}, + "incoming_call_context": {"key": "incomingCallContext", "type": "str"}, + "on_behalf_of_callee": {"key": "onBehalfOfCallee", "type": "CommunicationIdentifierModel"}, + "correlation_id": {"key": "correlationId", "type": "str"}, + } + + def __init__( + self, + *, + to: Optional["_models.CommunicationIdentifierModel"] = None, + from_property: Optional["_models.CommunicationIdentifierModel"] = None, + custom_context: Optional["_models.CustomCallingContext"] = None, + on_behalf_of_callee: Optional["_models.CommunicationIdentifierModel"] = None, + **kwargs: Any + ) -> None: + """ + :keyword to: 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. + :paramtype to: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword from_property: 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. + :paramtype from_property: + ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword custom_context: The custom calling context which will be sent to the target. + :paramtype custom_context: ~azure.communication.callautomation.models.CustomCallingContext + :keyword on_behalf_of_callee: 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. + :paramtype on_behalf_of_callee: + ~azure.communication.callautomation.models.CommunicationIdentifierModel + """ + super().__init__(**kwargs) + self.to = to + self.from_property = from_property + self.caller_display_name: Optional[str] = None + self.server_call_id: Optional[str] = None + self.custom_context = custom_context + self.incoming_call_context: Optional[str] = None + self.on_behalf_of_callee = on_behalf_of_callee + self.correlation_id: Optional[str] = None + + +class MediaStreamingFailed(_serialization.Model): + """MediaStreamingFailed. + + :ivar media_streaming_update: :vartype media_streaming_update: ~azure.communication.callautomation.models.MediaStreamingUpdate :ivar call_connection_id: Call connection ID. @@ -2310,14 +2432,10 @@ class MediaStreamingFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "media_streaming_update": {"readonly": True}, - } - _attribute_map = { "media_streaming_update": {"key": "mediaStreamingUpdate", "type": "MediaStreamingUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -2330,6 +2448,7 @@ class MediaStreamingFailed(_serialization.Model): def __init__( self, *, + media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -2338,6 +2457,9 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword media_streaming_update: + :paramtype media_streaming_update: + ~azure.communication.callautomation.models.MediaStreamingUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -2348,11 +2470,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None + self.media_streaming_update = media_streaming_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -2407,10 +2529,7 @@ def __init__( class MediaStreamingStarted(_serialization.Model): """MediaStreamingStarted. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar media_streaming_update: Defines the result for MediaStreamingUpdate with the current - status and the details about the status. + :ivar media_streaming_update: :vartype media_streaming_update: ~azure.communication.callautomation.models.MediaStreamingUpdate :ivar call_connection_id: Call connection ID. @@ -2423,14 +2542,10 @@ class MediaStreamingStarted(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "media_streaming_update": {"readonly": True}, - } - _attribute_map = { "media_streaming_update": {"key": "mediaStreamingUpdate", "type": "MediaStreamingUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -2443,6 +2558,7 @@ class MediaStreamingStarted(_serialization.Model): def __init__( self, *, + media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -2451,6 +2567,9 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword media_streaming_update: + :paramtype media_streaming_update: + ~azure.communication.callautomation.models.MediaStreamingUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -2461,11 +2580,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None + self.media_streaming_update = media_streaming_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -2476,10 +2595,7 @@ def __init__( class MediaStreamingStopped(_serialization.Model): """MediaStreamingStopped. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar media_streaming_update: Defines the result for MediaStreamingUpdate with the current - status and the details about the status. + :ivar media_streaming_update: :vartype media_streaming_update: ~azure.communication.callautomation.models.MediaStreamingUpdate :ivar call_connection_id: Call connection ID. @@ -2492,14 +2608,10 @@ class MediaStreamingStopped(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "media_streaming_update": {"readonly": True}, - } - _attribute_map = { "media_streaming_update": {"key": "mediaStreamingUpdate", "type": "MediaStreamingUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -2512,6 +2624,7 @@ class MediaStreamingStopped(_serialization.Model): def __init__( self, *, + media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -2520,6 +2633,9 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword media_streaming_update: + :paramtype media_streaming_update: + ~azure.communication.callautomation.models.MediaStreamingUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -2530,11 +2646,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.media_streaming_update: Optional["_models.MediaStreamingUpdate"] = None + self.media_streaming_update = media_streaming_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -2547,8 +2663,8 @@ class MediaStreamingSubscription(_serialization.Model): :ivar id: Subscription Id. :vartype id: str - :ivar state: Media streaming subscription state. Known values are: "disabled", "inactive", and - "active". + :ivar state: Current state of media streaming session. Known values are: "disabled", + "inactive", and "active". :vartype state: str or ~azure.communication.callautomation.models.MediaStreamingSubscriptionState :ivar subscribed_content_types: Subscribed media streaming content types. @@ -2567,14 +2683,14 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin state: Optional[Union[str, "_models.MediaStreamingSubscriptionState"]] = None, - subscribed_content_types: Optional[List[Union[str, "_models.MediaStreamingContentType"]]] = None, + subscribed_content_types: Optional[list[Union[str, "_models.MediaStreamingContentType"]]] = None, **kwargs: Any ) -> None: """ :keyword id: Subscription Id. :paramtype id: str - :keyword state: Media streaming subscription state. Known values are: "disabled", "inactive", - and "active". + :keyword state: Current state of media streaming session. Known values are: "disabled", + "inactive", and "active". :paramtype state: str or ~azure.communication.callautomation.models.MediaStreamingSubscriptionState :keyword subscribed_content_types: Subscribed media streaming content types. @@ -2734,13 +2850,269 @@ def __init__( self.cloud = cloud +class MoveParticipantFailed(_serialization.Model): + """Moving the participant failed 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 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: + :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar participant: 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. + :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar from_call: The CallConnectionId for the call you want to move the participant from. + :vartype from_call: 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"}, + "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, + "from_call": {"key": "fromCall", "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, + participant: Optional["_models.CommunicationIdentifierModel"] = None, + from_call: 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. 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: + :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword participant: 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. + :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword from_call: The CallConnectionId for the call you want to move the participant from. + :paramtype from_call: 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 + self.result_information = result_information + self.participant = participant + self.from_call = from_call + + +class MoveParticipantsRequest(_serialization.Model): + """The request payload for moving participant to the call. + + All required parameters must be populated in order to send to server. + + :ivar target_participants: The participant to Move. 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 + :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. + :vartype operation_callback_uri: str + :ivar from_call: The CallConnectionId for the call you want to move the participant from. + Required. + :vartype from_call: str + """ + + _validation = { + "target_participants": {"required": True}, + "from_call": {"required": True}, + } + + _attribute_map = { + "target_participants": {"key": "targetParticipants", "type": "[CommunicationIdentifierModel]"}, + "operation_context": {"key": "operationContext", "type": "str"}, + "operation_callback_uri": {"key": "operationCallbackUri", "type": "str"}, + "from_call": {"key": "fromCall", "type": "str"}, + } + + def __init__( + self, + *, + target_participants: list["_models.CommunicationIdentifierModel"], + from_call: str, + operation_context: Optional[str] = None, + operation_callback_uri: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword target_participants: The participant to Move. 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 + :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. + :paramtype operation_callback_uri: str + :keyword from_call: The CallConnectionId for the call you want to move the participant from. + Required. + :paramtype from_call: str + """ + super().__init__(**kwargs) + self.target_participants = target_participants + self.operation_context = operation_context + self.operation_callback_uri = operation_callback_uri + self.from_call = from_call + + +class MoveParticipantsResponse(_serialization.Model): + """The response payload for moving participants to the call. + + :ivar participants: List of current participants in the call. + :vartype participants: list[~azure.communication.callautomation.models.CallParticipant] + :ivar operation_context: The operation context provided by client. + :vartype operation_context: str + :ivar from_call: The CallConnectionId for the call you want to move the participant from. + :vartype from_call: str + """ + + _attribute_map = { + "participants": {"key": "participants", "type": "[CallParticipant]"}, + "operation_context": {"key": "operationContext", "type": "str"}, + "from_call": {"key": "fromCall", "type": "str"}, + } + + def __init__( + self, + *, + participants: Optional[list["_models.CallParticipant"]] = None, + operation_context: Optional[str] = None, + from_call: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword participants: List of current participants in the call. + :paramtype participants: list[~azure.communication.callautomation.models.CallParticipant] + :keyword operation_context: The operation context provided by client. + :paramtype operation_context: str + :keyword from_call: The CallConnectionId for the call you want to move the participant from. + :paramtype from_call: str + """ + super().__init__(**kwargs) + self.participants = participants + self.operation_context = operation_context + self.from_call = from_call + + +class MoveParticipantSucceeded(_serialization.Model): + """Moving the participant successfully 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 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: + :vartype result_information: ~azure.communication.callautomation.models.ResultInformation + :ivar participant: 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. + :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar from_call: The CallConnectionId for the call you want to move the participant from. + :vartype from_call: 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"}, + "result_information": {"key": "resultInformation", "type": "ResultInformation"}, + "participant": {"key": "participant", "type": "CommunicationIdentifierModel"}, + "from_call": {"key": "fromCall", "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, + participant: Optional["_models.CommunicationIdentifierModel"] = None, + from_call: 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. 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: + :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation + :keyword participant: 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. + :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword from_call: The CallConnectionId for the call you want to move the participant from. + :paramtype from_call: 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 + self.result_information = result_information + self.participant = participant + self.from_call = from_call + + class MuteParticipantsRequest(_serialization.Model): """The request payload for muting participants from the call. All required parameters must be populated in order to send to server. - :ivar target_participants: Participants to be muted from the call. - Only ACS Users are supported. Required. + :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 @@ -2760,13 +3132,13 @@ class MuteParticipantsRequest(_serialization.Model): def __init__( self, *, - target_participants: List["_models.CommunicationIdentifierModel"], + 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. + :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 @@ -2812,7 +3184,7 @@ class ParticipantsUpdated(_serialization.Model): :vartype sequence_number: int :ivar participants: The list of participants in the call. :vartype participants: list[~azure.communication.callautomation.models.CallParticipant] - :ivar result_information: Contains the resulting SIP code, sub-code and message. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -2832,7 +3204,7 @@ def __init__( server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, sequence_number: Optional[int] = None, - participants: Optional[List["_models.CallParticipant"]] = None, + participants: Optional[list["_models.CallParticipant"]] = None, result_information: Optional["_models.ResultInformation"] = None, **kwargs: Any ) -> None: @@ -2848,7 +3220,7 @@ def __init__( :paramtype sequence_number: int :keyword participants: The list of participants in the call. :paramtype participants: list[~azure.communication.callautomation.models.CallParticipant] - :keyword result_information: Contains the resulting SIP code, sub-code and message. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -2917,7 +3289,7 @@ class PlayCanceled(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -2950,7 +3322,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -2974,7 +3346,7 @@ class PlayCompleted(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -3007,7 +3379,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -3031,7 +3403,7 @@ class PlayFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation :ivar failed_play_source_index: Contains the index of the failed play source. :vartype failed_play_source_index: int @@ -3068,7 +3440,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation :keyword failed_play_source_index: Contains the index of the failed play source. :paramtype failed_play_source_index: int @@ -3115,20 +3487,19 @@ class PlayRequest(_serialization.Model): :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. + :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 interrupt_call_media_operation: If set play can barge into other existing queued-up/currently-processing requests. :vartype interrupt_call_media_operation: bool - :ivar play_options: Defines options for playing the audio. + :ivar play_options: :vartype play_options: ~azure.communication.callautomation.models.PlayOptions :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -3148,8 +3519,8 @@ class PlayRequest(_serialization.Model): def __init__( self, *, - play_sources: List["_models.PlaySource"], - play_to: Optional[List["_models.CommunicationIdentifierModel"]] = None, + play_sources: list["_models.PlaySource"], + play_to: Optional[list["_models.CommunicationIdentifierModel"]] = None, interrupt_call_media_operation: Optional[bool] = None, play_options: Optional["_models.PlayOptions"] = None, operation_context: Optional[str] = None, @@ -3159,21 +3530,20 @@ def __init__( """ :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. + :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 interrupt_call_media_operation: If set play can barge into other existing queued-up/currently-processing requests. :paramtype interrupt_call_media_operation: bool - :keyword play_options: Defines options for playing the audio. + :keyword play_options: :paramtype play_options: ~azure.communication.callautomation.models.PlayOptions :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -3190,16 +3560,16 @@ class PlaySource(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar kind: Defines the type of the play source. Required. Known values are: "file", "text", - and "ssml". + :ivar kind: Defines the types of play source. Required. Known values are: "file", "text", and + "ssml". :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. + :ivar file: :vartype file: ~azure.communication.callautomation.models.FileSource - :ivar text: Defines the text source info to be used for play. + :ivar text: :vartype text: ~azure.communication.callautomation.models.TextSource - :ivar ssml: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. + :ivar ssml: :vartype ssml: ~azure.communication.callautomation.models.SsmlSource """ @@ -3226,17 +3596,16 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword kind: Defines the type of the play source. Required. Known values are: "file", "text", + :keyword kind: Defines the types of play source. Required. Known values are: "file", "text", and "ssml". :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. + :keyword file: :paramtype file: ~azure.communication.callautomation.models.FileSource - :keyword text: Defines the text source info to be used for play. + :keyword text: :paramtype text: ~azure.communication.callautomation.models.TextSource - :keyword ssml: Defines the ssml(Speech Synthesis Markup Language) source info to be used for - play. + :keyword ssml: :paramtype ssml: ~azure.communication.callautomation.models.SsmlSource """ super().__init__(**kwargs) @@ -3260,7 +3629,7 @@ class PlayStarted(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -3293,7 +3662,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -3317,7 +3686,7 @@ class RecognizeCanceled(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -3350,7 +3719,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -3364,8 +3733,6 @@ def __init__( class RecognizeCompleted(_serialization.Model): """RecognizeCompleted. - 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. @@ -3376,24 +3743,20 @@ class RecognizeCompleted(_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. + :ivar result_information: :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", and "choices". + :ivar recognition_type: Recognition type determines the sub-type of the recognition operation + Possible values will be Dtmf, Speech, or Choices. Known values are: "dtmf", "speech", and + "choices". :vartype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType - :ivar dtmf_result: Defines the result for RecognitionType = Dtmf. + :ivar dtmf_result: :vartype dtmf_result: ~azure.communication.callautomation.models.DtmfResult - :ivar choice_result: Defines the result for RecognitionType = Choices. + :ivar choice_result: :vartype choice_result: ~azure.communication.callautomation.models.ChoiceResult - :ivar speech_result: Defines the result for RecognitionType = Speech and SpeechOrDtmf. + :ivar speech_result: The speech status as a result. :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"}, @@ -3417,6 +3780,7 @@ def __init__( recognition_type: Optional[Union[str, "_models.RecognitionType"]] = None, dtmf_result: Optional["_models.DtmfResult"] = None, choice_result: Optional["_models.ChoiceResult"] = None, + speech_result: Optional["_models.SpeechResult"] = None, **kwargs: Any ) -> None: """ @@ -3430,16 +3794,18 @@ 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. + :keyword result_information: :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", and "choices". + :keyword recognition_type: Recognition type determines the sub-type of the recognition + operation Possible values will be Dtmf, Speech, or Choices. Known values are: "dtmf", "speech", + and "choices". :paramtype recognition_type: str or ~azure.communication.callautomation.models.RecognitionType - :keyword dtmf_result: Defines the result for RecognitionType = Dtmf. + :keyword dtmf_result: :paramtype dtmf_result: ~azure.communication.callautomation.models.DtmfResult - :keyword choice_result: Defines the result for RecognitionType = Choices. + :keyword choice_result: :paramtype choice_result: ~azure.communication.callautomation.models.ChoiceResult + :keyword speech_result: The speech status as a result. + :paramtype speech_result: ~azure.communication.callautomation.models.SpeechResult """ super().__init__(**kwargs) self.call_connection_id = call_connection_id @@ -3450,7 +3816,7 @@ def __init__( self.recognition_type = recognition_type self.dtmf_result = dtmf_result self.choice_result = choice_result - self.speech_result: Optional["_models.SpeechResult"] = None + self.speech_result = speech_result class RecognizeFailed(_serialization.Model): @@ -3466,7 +3832,7 @@ class RecognizeFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation :ivar failed_play_source_index: Contains the index of the failed play source. :vartype failed_play_source_index: int @@ -3503,7 +3869,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation :keyword failed_play_source_index: Contains the index of the failed play source. :paramtype failed_play_source_index: int @@ -3526,18 +3892,21 @@ class RecognizeOptions(_serialization.Model): :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. + :ivar target_participant: 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. 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 speech_recognition_model_endpoint_id: Endpoint where the custom model was deployed. :vartype speech_recognition_model_endpoint_id: str - :ivar dtmf_options: Defines configurations for DTMF. + :ivar dtmf_options: Options for DTMF recognition. :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. + :ivar speech_options: Options for continuous speech recognition. :vartype speech_options: ~azure.communication.callautomation.models.SpeechOptions """ @@ -3566,7 +3935,7 @@ def __init__( speech_language: Optional[str] = None, speech_recognition_model_endpoint_id: Optional[str] = None, dtmf_options: Optional["_models.DtmfOptions"] = None, - choices: Optional[List["_models.Choice"]] = None, + choices: Optional[list["_models.Choice"]] = None, speech_options: Optional["_models.SpeechOptions"] = None, **kwargs: Any ) -> None: @@ -3576,18 +3945,21 @@ def __init__( :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. + :keyword target_participant: 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. 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 speech_recognition_model_endpoint_id: Endpoint where the custom model was deployed. :paramtype speech_recognition_model_endpoint_id: str - :keyword dtmf_options: Defines configurations for DTMF. + :keyword dtmf_options: Options for DTMF recognition. :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. + :keyword speech_options: Options for continuous speech recognition. :paramtype speech_options: ~azure.communication.callautomation.models.SpeechOptions """ super().__init__(**kwargs) @@ -3606,25 +3978,24 @@ class RecognizeRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar recognize_input_type: Determines the type of the recognition. Required. Known values are: - "dtmf", "speech", "speechOrDtmf", and "choices". + :ivar recognize_input_type: Defines the type of the recognize input. 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. + :ivar play_prompt: :vartype play_prompt: ~azure.communication.callautomation.models.PlaySource :ivar play_prompts: The source of the audio to be played for recognition. :vartype play_prompts: list[~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. + :ivar recognize_options: 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 operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -3649,32 +4020,31 @@ def __init__( recognize_input_type: Union[str, "_models.RecognizeInputType"], recognize_options: "_models.RecognizeOptions", play_prompt: Optional["_models.PlaySource"] = None, - play_prompts: Optional[List["_models.PlaySource"]] = None, + play_prompts: Optional[list["_models.PlaySource"]] = None, interrupt_call_media_operation: Optional[bool] = None, operation_context: Optional[str] = None, operation_callback_uri: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword recognize_input_type: Determines the type of the recognition. Required. Known values + :keyword recognize_input_type: Defines the type of the recognize input. 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. + :keyword play_prompt: :paramtype play_prompt: ~azure.communication.callautomation.models.PlaySource :keyword play_prompts: The source of the audio to be played for recognition. :paramtype play_prompts: list[~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. + :keyword recognize_options: 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 operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -3705,10 +4075,10 @@ class RecordingStateChanged(_serialization.Model): :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 recording_kind: Known values are: "AzureCommunicationServices", "Teams", and - "TeamsCompliance". + :ivar recording_kind: Known values are: "azureCommunicationServices", "teams", and + "teamsCompliance". :vartype recording_kind: str or ~azure.communication.callautomation.models.RecordingKind - :ivar result_information: Contains the resulting SIP code, sub-code and message. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -3749,10 +4119,10 @@ def __init__( :paramtype correlation_id: str :keyword state: Known values are: "active" and "inactive". :paramtype state: str or ~azure.communication.callautomation.models.RecordingState - :keyword recording_kind: Known values are: "AzureCommunicationServices", "Teams", and - "TeamsCompliance". + :keyword recording_kind: Known values are: "azureCommunicationServices", "teams", and + "teamsCompliance". :paramtype recording_kind: str or ~azure.communication.callautomation.models.RecordingKind - :keyword result_information: Contains the resulting SIP code, sub-code and message. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -3773,8 +4143,8 @@ class RecordingStateResponse(_serialization.Model): :vartype recording_id: str :ivar recording_state: Known values are: "active" and "inactive". :vartype recording_state: str or ~azure.communication.callautomation.models.RecordingState - :ivar recording_kind: Known values are: "AzureCommunicationServices", "Teams", and - "TeamsCompliance". + :ivar recording_kind: Known values are: "azureCommunicationServices", "teams", and + "teamsCompliance". :vartype recording_kind: str or ~azure.communication.callautomation.models.RecordingKind """ @@ -3797,8 +4167,8 @@ def __init__( :paramtype recording_id: str :keyword recording_state: Known values are: "active" and "inactive". :paramtype recording_state: str or ~azure.communication.callautomation.models.RecordingState - :keyword recording_kind: Known values are: "AzureCommunicationServices", "Teams", and - "TeamsCompliance". + :keyword recording_kind: Known values are: "azureCommunicationServices", "teams", and + "teamsCompliance". :paramtype recording_kind: str or ~azure.communication.callautomation.models.RecordingKind """ super().__init__(**kwargs) @@ -3814,7 +4184,10 @@ class RedirectCallRequest(_serialization.Model): :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. + :ivar target: 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. + Required. :vartype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -3834,7 +4207,10 @@ def __init__( """ :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. + :keyword target: 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. Required. :paramtype target: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -3849,7 +4225,7 @@ class RejectCallRequest(_serialization.Model): :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 + :ivar call_reject_reason: Reason of rejecting a call. Known values are: "none", "busy", and "forbidden". :vartype call_reject_reason: str or ~azure.communication.callautomation.models.CallRejectReason """ @@ -3873,7 +4249,7 @@ def __init__( """ :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 + :keyword call_reject_reason: Reason of rejecting a call. Known values are: "none", "busy", and "forbidden". :paramtype call_reject_reason: str or ~azure.communication.callautomation.models.CallRejectReason @@ -3896,9 +4272,12 @@ class RemoveParticipantFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. + :ivar participant: 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. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -3933,9 +4312,12 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. + :keyword participant: 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. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -3952,16 +4334,18 @@ class RemoveParticipantRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar participant_to_remove: The participants to be removed from the call. Required. + :ivar participant_to_remove: 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. Required. :vartype participant_to_remove: ~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 operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -3984,16 +4368,18 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword participant_to_remove: The participants to be removed from the call. Required. + :keyword participant_to_remove: 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. Required. :paramtype participant_to_remove: ~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 operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -4035,9 +4421,12 @@ class RemoveParticipantSucceeded(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation - :ivar participant: Participant. + :ivar participant: 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. :vartype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ @@ -4072,9 +4461,12 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation - :keyword participant: Participant. + :keyword participant: 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. :paramtype participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel """ super().__init__(**kwargs) @@ -4097,12 +4489,18 @@ class ResultInformation(_serialization.Model): :vartype sub_code: int :ivar message: Detail message that describes the current result. :vartype message: str + :ivar sip_details: + :vartype sip_details: ~azure.communication.callautomation.models.SipDiagnosticInfo + :ivar q850_details: + :vartype q850_details: ~azure.communication.callautomation.models.SipDiagnosticInfo """ _attribute_map = { "code": {"key": "code", "type": "int"}, "sub_code": {"key": "subCode", "type": "int"}, "message": {"key": "message", "type": "str"}, + "sip_details": {"key": "sipDetails", "type": "SipDiagnosticInfo"}, + "q850_details": {"key": "q850Details", "type": "SipDiagnosticInfo"}, } def __init__( @@ -4111,6 +4509,8 @@ def __init__( code: Optional[int] = None, sub_code: Optional[int] = None, message: Optional[str] = None, + sip_details: Optional["_models.SipDiagnosticInfo"] = None, + q850_details: Optional["_models.SipDiagnosticInfo"] = None, **kwargs: Any ) -> None: """ @@ -4122,11 +4522,17 @@ def __init__( :paramtype sub_code: int :keyword message: Detail message that describes the current result. :paramtype message: str + :keyword sip_details: + :paramtype sip_details: ~azure.communication.callautomation.models.SipDiagnosticInfo + :keyword q850_details: + :paramtype q850_details: ~azure.communication.callautomation.models.SipDiagnosticInfo """ super().__init__(**kwargs) self.code = code self.sub_code = sub_code self.message = message + self.sip_details = sip_details + self.q850_details = q850_details class SendDtmfTonesCompleted(_serialization.Model): @@ -4142,7 +4548,7 @@ class SendDtmfTonesCompleted(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -4175,7 +4581,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -4199,7 +4605,7 @@ class SendDtmfTonesFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -4232,7 +4638,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -4250,15 +4656,17 @@ class SendDtmfTonesRequest(_serialization.Model): :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 tones. Required. + :ivar target_participant: 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. Required. :vartype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -4277,7 +4685,7 @@ class SendDtmfTonesRequest(_serialization.Model): def __init__( self, *, - tones: List[Union[str, "_models.DtmfTone"]], + tones: list[Union[str, "_models.DtmfTone"]], target_participant: "_models.CommunicationIdentifierModel", operation_context: Optional[str] = None, operation_callback_uri: Optional[str] = None, @@ -4286,15 +4694,17 @@ def __init__( """ :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 tones. Required. + :keyword target_participant: 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. Required. :paramtype target_participant: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -4324,6 +4734,34 @@ def __init__(self, *, operation_context: Optional[str] = None, **kwargs: Any) -> self.operation_context = operation_context +class SipDiagnosticInfo(_serialization.Model): + """SipDiagnosticInfo. + + :ivar code: Represents the diagnostic code returned by the SIP service, used for identifying + specific issues or statuses. + :vartype code: int + :ivar message: Message associated with the code for diagnosing. + :vartype message: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "int"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, code: Optional[int] = None, message: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword code: Represents the diagnostic code returned by the SIP service, used for identifying + specific issues or statuses. + :paramtype code: int + :keyword message: Message associated with the code for diagnosing. + :paramtype message: str + """ + super().__init__(**kwargs) + self.code = code + self.message = message + + class SpeechOptions(_serialization.Model): """Options for continuous speech recognition. @@ -4409,7 +4847,7 @@ def __init__(self, *, ssml_text: str, custom_voice_endpoint_id: Optional[str] = class StartCallRecordingRequest(_serialization.Model): """The request payload start for call recording operation with call locator. - :ivar call_locator: The call locator. (Only one of callLocator or callConnectionId to be used). + :ivar call_locator: The locator used for joining or taking action on a call. :vartype call_locator: ~azure.communication.callautomation.models.CallLocator :ivar call_connection_id: The call connection Id. (Only one of callLocator or callConnectionId to be used). @@ -4420,34 +4858,31 @@ class StartCallRecordingRequest(_serialization.Model): "audioVideo". :vartype recording_content_type: str or ~azure.communication.callautomation.models.RecordingContent - :ivar recording_channel_type: The channel type of call recording. Known values are: "mixed" and - "unmixed". + :ivar recording_channel_type: Defines the channel type of call recording. Known values are: + "mixed" and "unmixed". :vartype recording_channel_type: str or ~azure.communication.callautomation.models.RecordingChannel - :ivar recording_format_type: The format type of call recording. Known values are: "wav", "mp3", - and "mp4". + :ivar recording_format_type: Defines the format type of call recording. Known values are: + "wav", "mp3", and "mp4". :vartype recording_format_type: str or ~azure.communication.callautomation.models.RecordingFormat :ivar audio_channel_participant_ordering: The sequential order in which audio channels are - assigned to participants in the unmixed recording. - When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not - specified, - the audio channel to participant mapping will be automatically assigned based on the order in - which participant + assigned to participants in the unmixed recording. When 'recordingChannelType' is set to + 'unmixed' and `audioChannelParticipantOrdering is not specified, the audio channel to + participant mapping will be automatically assigned based on the order in which participant first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. :vartype audio_channel_participant_ordering: list[~azure.communication.callautomation.models.CommunicationIdentifierModel] - :ivar 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. + :ivar 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. ///. :vartype channel_affinity: list[~azure.communication.callautomation.models.ChannelAffinity] :ivar pause_on_start: When set to true will start recording in Pause mode, which can be resumed. :vartype pause_on_start: bool - :ivar external_storage: Optional property to specify location where recording will be stored. + :ivar external_storage: :vartype external_storage: ~azure.communication.callautomation.models.ExternalStorage """ @@ -4476,15 +4911,14 @@ def __init__( recording_content_type: Optional[Union[str, "_models.RecordingContent"]] = None, recording_channel_type: Optional[Union[str, "_models.RecordingChannel"]] = None, 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, + audio_channel_participant_ordering: Optional[list["_models.CommunicationIdentifierModel"]] = None, + channel_affinity: Optional[list["_models.ChannelAffinity"]] = None, pause_on_start: Optional[bool] = None, external_storage: Optional["_models.ExternalStorage"] = None, **kwargs: Any ) -> None: """ - :keyword call_locator: The call locator. (Only one of callLocator or callConnectionId to be - used). + :keyword call_locator: The locator used for joining or taking action on a call. :paramtype call_locator: ~azure.communication.callautomation.models.CallLocator :keyword call_connection_id: The call connection Id. (Only one of callLocator or callConnectionId to be used). @@ -4495,35 +4929,31 @@ def __init__( and "audioVideo". :paramtype recording_content_type: str or ~azure.communication.callautomation.models.RecordingContent - :keyword recording_channel_type: The channel type of call recording. Known values are: "mixed" - and "unmixed". + :keyword recording_channel_type: Defines the channel type of call recording. Known values are: + "mixed" and "unmixed". :paramtype recording_channel_type: str or ~azure.communication.callautomation.models.RecordingChannel - :keyword recording_format_type: The format type of call recording. Known values are: "wav", - "mp3", and "mp4". + :keyword recording_format_type: Defines the format type of call recording. Known values are: + "wav", "mp3", and "mp4". :paramtype recording_format_type: str or ~azure.communication.callautomation.models.RecordingFormat :keyword audio_channel_participant_ordering: The sequential order in which audio channels are - assigned to participants in the unmixed recording. - When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not - specified, - the audio channel to participant mapping will be automatically assigned based on the order in - which participant + assigned to participants in the unmixed recording. When 'recordingChannelType' is set to + 'unmixed' and `audioChannelParticipantOrdering is not specified, the audio channel to + participant mapping will be automatically assigned based on the order in 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.models.CommunicationIdentifierModel] - :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. + :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.models.ChannelAffinity] :keyword pause_on_start: When set to true will start recording in Pause mode, which can be resumed. :paramtype pause_on_start: bool - :keyword external_storage: Optional property to specify location where recording will be - stored. + :keyword external_storage: :paramtype external_storage: ~azure.communication.callautomation.models.ExternalStorage """ super().__init__(**kwargs) @@ -4543,9 +4973,8 @@ class StartMediaStreamingRequest(_serialization.Model): """StartMediaStreamingRequest. :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str @@ -4561,9 +4990,8 @@ def __init__( ) -> None: """ :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str @@ -4590,7 +5018,7 @@ class StartRecordingFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ @@ -4628,7 +5056,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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) @@ -4651,9 +5079,8 @@ class StartTranscriptionRequest(_serialization.Model): :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -4682,9 +5109,8 @@ def __init__( :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -4698,9 +5124,8 @@ class StopMediaStreamingRequest(_serialization.Model): """StopMediaStreamingRequest. :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str @@ -4716,9 +5141,8 @@ def __init__( ) -> None: """ :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str @@ -4734,9 +5158,8 @@ class StopTranscriptionRequest(_serialization.Model): :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -4752,9 +5175,8 @@ def __init__( :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -4823,6 +5245,254 @@ def __init__( self.cloud = cloud +class TeamsPhoneCallDetails(_serialization.Model): + """The call details which will be sent to the target. + + :ivar teams_phone_caller_details: Container for details relating to the original caller of the + call. + :vartype teams_phone_caller_details: + ~azure.communication.callautomation.models.TeamsPhoneCallerDetails + :ivar teams_phone_source_details: Container for details relating to the entity responsible for + the creation of these call details. + :vartype teams_phone_source_details: + ~azure.communication.callautomation.models.TeamsPhoneSourceDetails + :ivar session_id: Id to exclusively identify this call session. IVR will use this for their + telemetry/reporting. + :vartype session_id: str + :ivar intent: The intent of the call. + :vartype intent: str + :ivar call_topic: A very short description (max 48 chars) of the reason for the call. To be + displayed in Teams CallNotification. + :vartype call_topic: str + :ivar call_context: A summary of the call thus far. It will be displayed on a side panel in the + Teams UI. + :vartype call_context: str + :ivar transcript_url: Url for fetching the transcript of the call. + :vartype transcript_url: str + :ivar call_sentiment: Sentiment of the call thus far. + :vartype call_sentiment: str + :ivar suggested_actions: Recommendations for resolving the issue based on the customer's intent + and interaction history. + :vartype suggested_actions: str + """ + + _attribute_map = { + "teams_phone_caller_details": {"key": "teamsPhoneCallerDetails", "type": "TeamsPhoneCallerDetails"}, + "teams_phone_source_details": {"key": "teamsPhoneSourceDetails", "type": "TeamsPhoneSourceDetails"}, + "session_id": {"key": "sessionId", "type": "str"}, + "intent": {"key": "intent", "type": "str"}, + "call_topic": {"key": "callTopic", "type": "str"}, + "call_context": {"key": "callContext", "type": "str"}, + "transcript_url": {"key": "transcriptUrl", "type": "str"}, + "call_sentiment": {"key": "callSentiment", "type": "str"}, + "suggested_actions": {"key": "suggestedActions", "type": "str"}, + } + + def __init__( + self, + *, + teams_phone_caller_details: Optional["_models.TeamsPhoneCallerDetails"] = None, + teams_phone_source_details: Optional["_models.TeamsPhoneSourceDetails"] = None, + session_id: Optional[str] = None, + intent: Optional[str] = None, + call_topic: Optional[str] = None, + call_context: Optional[str] = None, + transcript_url: Optional[str] = None, + call_sentiment: Optional[str] = None, + suggested_actions: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword teams_phone_caller_details: Container for details relating to the original caller of + the call. + :paramtype teams_phone_caller_details: + ~azure.communication.callautomation.models.TeamsPhoneCallerDetails + :keyword teams_phone_source_details: Container for details relating to the entity responsible + for the creation of these call details. + :paramtype teams_phone_source_details: + ~azure.communication.callautomation.models.TeamsPhoneSourceDetails + :keyword session_id: Id to exclusively identify this call session. IVR will use this for their + telemetry/reporting. + :paramtype session_id: str + :keyword intent: The intent of the call. + :paramtype intent: str + :keyword call_topic: A very short description (max 48 chars) of the reason for the call. To be + displayed in Teams CallNotification. + :paramtype call_topic: str + :keyword call_context: A summary of the call thus far. It will be displayed on a side panel in + the Teams UI. + :paramtype call_context: str + :keyword transcript_url: Url for fetching the transcript of the call. + :paramtype transcript_url: str + :keyword call_sentiment: Sentiment of the call thus far. + :paramtype call_sentiment: str + :keyword suggested_actions: Recommendations for resolving the issue based on the customer's + intent and interaction history. + :paramtype suggested_actions: str + """ + super().__init__(**kwargs) + self.teams_phone_caller_details = teams_phone_caller_details + self.teams_phone_source_details = teams_phone_source_details + self.session_id = session_id + self.intent = intent + self.call_topic = call_topic + self.call_context = call_context + self.transcript_url = transcript_url + self.call_sentiment = call_sentiment + self.suggested_actions = suggested_actions + + +class TeamsPhoneCallerDetails(_serialization.Model): + """Container for details relating to the original caller of the call. + + All required parameters must be populated in order to send to server. + + :ivar caller: 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. + Required. + :vartype caller: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar name: Caller's name. Required. + :vartype name: str + :ivar phone_number: Caller's phone number. Required. + :vartype phone_number: str + :ivar record_id: Caller's record ID (ex in CRM). + :vartype record_id: str + :ivar screen_pop_url: Caller's screen pop URL. + :vartype screen_pop_url: str + :ivar is_authenticated: Flag indicating whether the caller was authenticated. + :vartype is_authenticated: bool + :ivar additional_caller_information: A set of key value pairs (max 10, any additional entries + would be ignored) which a bot author wants to pass to the Teams Client for display to the + agent. + :vartype additional_caller_information: dict[str, str] + """ + + _validation = { + "caller": {"required": True}, + "name": {"required": True}, + "phone_number": {"required": True}, + } + + _attribute_map = { + "caller": {"key": "caller", "type": "CommunicationIdentifierModel"}, + "name": {"key": "name", "type": "str"}, + "phone_number": {"key": "phoneNumber", "type": "str"}, + "record_id": {"key": "recordId", "type": "str"}, + "screen_pop_url": {"key": "screenPopUrl", "type": "str"}, + "is_authenticated": {"key": "isAuthenticated", "type": "bool"}, + "additional_caller_information": {"key": "additionalCallerInformation", "type": "{str}"}, + } + + def __init__( + self, + *, + caller: "_models.CommunicationIdentifierModel", + name: str, + phone_number: str, + record_id: Optional[str] = None, + screen_pop_url: Optional[str] = None, + is_authenticated: Optional[bool] = None, + additional_caller_information: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword caller: 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. Required. + :paramtype caller: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword name: Caller's name. Required. + :paramtype name: str + :keyword phone_number: Caller's phone number. Required. + :paramtype phone_number: str + :keyword record_id: Caller's record ID (ex in CRM). + :paramtype record_id: str + :keyword screen_pop_url: Caller's screen pop URL. + :paramtype screen_pop_url: str + :keyword is_authenticated: Flag indicating whether the caller was authenticated. + :paramtype is_authenticated: bool + :keyword additional_caller_information: A set of key value pairs (max 10, any additional + entries would be ignored) which a bot author wants to pass to the Teams Client for display to + the agent. + :paramtype additional_caller_information: dict[str, str] + """ + super().__init__(**kwargs) + self.caller = caller + self.name = name + self.phone_number = phone_number + self.record_id = record_id + self.screen_pop_url = screen_pop_url + self.is_authenticated = is_authenticated + self.additional_caller_information = additional_caller_information + + +class TeamsPhoneSourceDetails(_serialization.Model): + """Container for details relating to the entity responsible for the creation of these call + details. + + All required parameters must be populated in order to send to server. + + :ivar source: 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. + Required. + :vartype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :ivar language: Language of the source entity passing along the call details, passed in the + ISO-639 standard. Required. + :vartype language: str + :ivar status: Status of the source entity passing along the call details. Required. + :vartype status: str + :ivar intended_targets: Intended targets of the source entity passing along the call details. + :vartype intended_targets: dict[str, + ~azure.communication.callautomation.models.CommunicationIdentifierModel] + """ + + _validation = { + "source": {"required": True}, + "language": {"required": True}, + "status": {"required": True}, + } + + _attribute_map = { + "source": {"key": "source", "type": "CommunicationIdentifierModel"}, + "language": {"key": "language", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "intended_targets": {"key": "intendedTargets", "type": "{CommunicationIdentifierModel}"}, + } + + def __init__( + self, + *, + source: "_models.CommunicationIdentifierModel", + language: str, + status: str, + intended_targets: Optional[dict[str, "_models.CommunicationIdentifierModel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword source: 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. Required. + :paramtype source: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword language: Language of the source entity passing along the call details, passed in the + ISO-639 standard. Required. + :paramtype language: str + :keyword status: Status of the source entity passing along the call details. Required. + :paramtype status: str + :keyword intended_targets: Intended targets of the source entity passing along the call + details. + :paramtype intended_targets: dict[str, + ~azure.communication.callautomation.models.CommunicationIdentifierModel] + """ + super().__init__(**kwargs) + self.source = source + self.language = language + self.status = status + self.intended_targets = intended_targets + + class TextSource(_serialization.Model): """TextSource. @@ -4830,15 +5500,15 @@ class TextSource(_serialization.Model): :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_kind: Voice kind type. Known values are: "male" and "female". + :ivar voice_kind: Audio kind type. Known values are: "male" and "female". :vartype voice_kind: str or ~azure.communication.callautomation.models.VoiceKind - :ivar voice_name: Voice name to be played - Refer to available Text-to-speech voices here: :code:``. :vartype voice_name: str @@ -4871,15 +5541,15 @@ def __init__( """ :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_kind: Voice kind type. Known values are: "male" and "female". + :keyword voice_kind: Audio kind type. Known values are: "male" and "female". :paramtype voice_kind: str or ~azure.communication.callautomation.models.VoiceKind - :keyword voice_name: Voice name to be played - Refer to available Text-to-speech voices here: :code:``. :paramtype voice_name: str @@ -4897,10 +5567,7 @@ def __init__( class TranscriptionFailed(_serialization.Model): """TranscriptionFailed. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transcription_update: Defines the result for TranscriptionUpdate with the current status - and the details about the status. + :ivar transcription_update: :vartype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -4912,14 +5579,10 @@ class TranscriptionFailed(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "transcription_update": {"readonly": True}, - } - _attribute_map = { "transcription_update": {"key": "transcriptionUpdate", "type": "TranscriptionUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -4932,6 +5595,7 @@ class TranscriptionFailed(_serialization.Model): def __init__( self, *, + transcription_update: Optional["_models.TranscriptionUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -4940,6 +5604,8 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword transcription_update: + :paramtype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -4950,11 +5616,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.transcription_update: Optional["_models.TranscriptionUpdate"] = None + self.transcription_update = transcription_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -5003,10 +5669,7 @@ def __init__(self, *, locale: str, **kwargs: Any) -> None: class TranscriptionStarted(_serialization.Model): """TranscriptionStarted. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transcription_update: Defines the result for TranscriptionUpdate with the current status - and the details about the status. + :ivar transcription_update: :vartype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -5018,14 +5681,10 @@ class TranscriptionStarted(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "transcription_update": {"readonly": True}, - } - _attribute_map = { "transcription_update": {"key": "transcriptionUpdate", "type": "TranscriptionUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -5038,6 +5697,7 @@ class TranscriptionStarted(_serialization.Model): def __init__( self, *, + transcription_update: Optional["_models.TranscriptionUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -5046,6 +5706,8 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword transcription_update: + :paramtype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -5056,11 +5718,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.transcription_update: Optional["_models.TranscriptionUpdate"] = None + self.transcription_update = transcription_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -5071,10 +5733,7 @@ def __init__( class TranscriptionStopped(_serialization.Model): """TranscriptionStopped. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transcription_update: Defines the result for TranscriptionUpdate with the current status - and the details about the status. + :ivar transcription_update: :vartype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -5086,14 +5745,10 @@ class TranscriptionStopped(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "transcription_update": {"readonly": True}, - } - _attribute_map = { "transcription_update": {"key": "transcriptionUpdate", "type": "TranscriptionUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -5106,6 +5761,7 @@ class TranscriptionStopped(_serialization.Model): def __init__( self, *, + transcription_update: Optional["_models.TranscriptionUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -5114,6 +5770,8 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword transcription_update: + :paramtype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -5124,11 +5782,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.transcription_update: Optional["_models.TranscriptionUpdate"] = None + self.transcription_update = transcription_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -5141,8 +5799,8 @@ class TranscriptionSubscription(_serialization.Model): :ivar id: Subscription Id. :vartype id: str - :ivar state: Transcription subscription state. Known values are: "disabled", "inactive", and - "active". + :ivar state: Current state of transcription session. Known values are: "disabled", "inactive", + and "active". :vartype state: str or ~azure.communication.callautomation.models.TranscriptionSubscriptionState :ivar subscribed_result_types: Subscribed transcription result types. @@ -5164,15 +5822,15 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin state: Optional[Union[str, "_models.TranscriptionSubscriptionState"]] = None, - subscribed_result_types: Optional[List[Union[str, "_models.TranscriptionResultType"]]] = None, + subscribed_result_types: Optional[list[Union[str, "_models.TranscriptionResultType"]]] = None, locale: Optional[str] = None, **kwargs: Any ) -> None: """ :keyword id: Subscription Id. :paramtype id: str - :keyword state: Transcription subscription state. Known values are: "disabled", "inactive", and - "active". + :keyword state: Current state of transcription session. Known values are: "disabled", + "inactive", and "active". :paramtype state: str or ~azure.communication.callautomation.models.TranscriptionSubscriptionState :keyword subscribed_result_types: Subscribed transcription result types. @@ -5237,10 +5895,7 @@ def __init__( class TranscriptionUpdated(_serialization.Model): """TranscriptionUpdated. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transcription_update: Defines the result for TranscriptionUpdate with the current status - and the details about the status. + :ivar transcription_update: :vartype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :ivar call_connection_id: Call connection ID. :vartype call_connection_id: str @@ -5252,14 +5907,10 @@ class TranscriptionUpdated(_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. + :ivar result_information: :vartype result_information: ~azure.communication.callautomation.models.ResultInformation """ - _validation = { - "transcription_update": {"readonly": True}, - } - _attribute_map = { "transcription_update": {"key": "transcriptionUpdate", "type": "TranscriptionUpdate"}, "call_connection_id": {"key": "callConnectionId", "type": "str"}, @@ -5272,6 +5923,7 @@ class TranscriptionUpdated(_serialization.Model): def __init__( self, *, + transcription_update: Optional["_models.TranscriptionUpdate"] = None, call_connection_id: Optional[str] = None, server_call_id: Optional[str] = None, correlation_id: Optional[str] = None, @@ -5280,6 +5932,8 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword transcription_update: + :paramtype transcription_update: ~azure.communication.callautomation.models.TranscriptionUpdate :keyword call_connection_id: Call connection ID. :paramtype call_connection_id: str :keyword server_call_id: Server call ID. @@ -5290,11 +5944,11 @@ 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. + :keyword result_information: :paramtype result_information: ~azure.communication.callautomation.models.ResultInformation """ super().__init__(**kwargs) - self.transcription_update: Optional["_models.TranscriptionUpdate"] = None + self.transcription_update = transcription_update self.call_connection_id = call_connection_id self.server_call_id = server_call_id self.correlation_id = correlation_id @@ -5327,25 +5981,28 @@ class TransferToParticipantRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar target_participant: The identity of the target where call should be transferred to. - Required. + :ivar target_participant: 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. 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 transferee: Transferee is the participant who is transferred away. + :ivar transferee: 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. :vartype transferee: ~azure.communication.callautomation.models.CommunicationIdentifierModel :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str - :ivar custom_calling_context: Used by customer to send custom calling context to targets. + :ivar custom_calling_context: The custom calling context which will be sent to the target. :vartype custom_calling_context: ~azure.communication.callautomation.models.CustomCallingContext - :ivar source_caller_id_number: The source caller Id, a phone number, that will be used as the - transferor's caller Id when transferring a call to a Pstn target. + :ivar source_caller_id_number: A phone number. :vartype source_caller_id_number: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel """ @@ -5375,25 +6032,28 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword target_participant: The identity of the target where call should be transferred to. - Required. + :keyword target_participant: 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. 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 transferee: Transferee is the participant who is transferred away. + :keyword transferee: 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. :paramtype transferee: ~azure.communication.callautomation.models.CommunicationIdentifierModel :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str - :keyword custom_calling_context: Used by customer to send custom calling context to targets. + :keyword custom_calling_context: The custom calling context which will be sent to the target. :paramtype custom_calling_context: ~azure.communication.callautomation.models.CustomCallingContext - :keyword source_caller_id_number: The source caller Id, a phone number, that will be used as - the transferor's caller Id when transferring a call to a Pstn target. + :keyword source_caller_id_number: A phone number. :paramtype source_caller_id_number: ~azure.communication.callautomation.models.PhoneNumberIdentifierModel """ @@ -5411,17 +6071,18 @@ class UnholdRequest(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar target_participant: Participants to be hold from the call. - Only ACS Users are supported. Required. + :ivar target_participant: 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. 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 operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -5444,17 +6105,18 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword target_participant: Participants to be hold from the call. - Only ACS Users are supported. Required. + :keyword target_participant: 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. 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 operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -5474,9 +6136,8 @@ class UpdateTranscriptionRequest(_serialization.Model): :ivar operation_context: The value to identify context of the operation. :vartype operation_context: str :ivar operation_callback_uri: Set a callback URI that overrides the default callback URI set by - CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :vartype operation_callback_uri: str """ @@ -5505,9 +6166,8 @@ def __init__( :keyword operation_context: The value to identify context of the operation. :paramtype operation_context: str :keyword operation_callback_uri: Set a callback URI that overrides the default callback URI set - by CreateCall/AnswerCall for this operation. - This setup is per-action. If this is not set, the default callback URI set by - CreateCall/AnswerCall will be used. + by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the + default callback URI set by CreateCall/AnswerCall will be used. :paramtype operation_callback_uri: str """ super().__init__(**kwargs) @@ -5532,7 +6192,7 @@ class WebSocketMediaStreamingOptions(MediaStreamingOptions): ~azure.communication.callautomation.models.MediaStreamingAudioChannelType :ivar transport_url: The transport URL for media streaming. :vartype transport_url: str - :ivar content_type: "audio" + :ivar content_type: Type of content in Media streaming. "audio" :vartype content_type: str or ~azure.communication.callautomation.models.MediaStreamingContentType :ivar start_media_streaming: A value indicating whether the media streaming should start @@ -5540,8 +6200,8 @@ class WebSocketMediaStreamingOptions(MediaStreamingOptions): :vartype start_media_streaming: bool :ivar enable_bidirectional: A value indicating whether bidirectional streaming is enabled. :vartype enable_bidirectional: bool - :ivar audio_format: The audio format used for encoding, including sample rate and channel type. - The default is Pcm16KMono. Known values are: "pcm16KMono" and "pcm24KMono". + :ivar audio_format: The format of the audio received from the audio subscription option. Known + values are: "pcm16KMono" and "pcm24KMono". :vartype audio_format: str or ~azure.communication.callautomation.models.AudioFormat :ivar enable_dtmf_tones: A value that indicates whether to stream the DTMF tones. :vartype enable_dtmf_tones: bool @@ -5582,7 +6242,7 @@ def __init__( ~azure.communication.callautomation.models.MediaStreamingAudioChannelType :keyword transport_url: The transport URL for media streaming. :paramtype transport_url: str - :keyword content_type: "audio" + :keyword content_type: Type of content in Media streaming. "audio" :paramtype content_type: str or ~azure.communication.callautomation.models.MediaStreamingContentType :keyword start_media_streaming: A value indicating whether the media streaming should start @@ -5590,8 +6250,8 @@ def __init__( :paramtype start_media_streaming: bool :keyword enable_bidirectional: A value indicating whether bidirectional streaming is enabled. :paramtype enable_bidirectional: bool - :keyword audio_format: The audio format used for encoding, including sample rate and channel - type. The default is Pcm16KMono. Known values are: "pcm16KMono" and "pcm24KMono". + :keyword audio_format: The format of the audio received from the audio subscription option. + Known values are: "pcm16KMono" and "pcm24KMono". :paramtype audio_format: str or ~azure.communication.callautomation.models.AudioFormat :keyword enable_dtmf_tones: A value that indicates whether to stream the DTMF tones. :paramtype enable_dtmf_tones: bool 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 e546554065c6..8d9dd87999b5 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 @@ -9,7 +9,7 @@ from collections.abc import MutableMapping import datetime from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload import urllib.parse import uuid @@ -34,7 +34,7 @@ from .._utils.utils import ClientMixinABC T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -47,7 +47,7 @@ def build_azure_communication_call_automation_service_create_call_request( # py _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +77,7 @@ def build_azure_communication_call_automation_service_answer_call_request( # py _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_azure_communication_call_automation_service_redirect_call_request( # _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +137,7 @@ def build_azure_communication_call_automation_service_reject_call_request( # py _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_azure_communication_call_automation_service_connect_request( # pylint _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +194,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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +220,7 @@ def build_call_connection_hangup_call_request( # pylint: disable=name-too-long _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +246,7 @@ def build_call_connection_terminate_call_request( # pylint: disable=name-too-lo _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +279,7 @@ def build_call_connection_transfer_to_participant_request( # pylint: disable=na _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -313,7 +313,7 @@ def build_call_connection_get_participants_request( # pylint: disable=name-too- _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +340,7 @@ def build_call_connection_add_participant_request( # pylint: disable=name-too-l _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -375,7 +375,7 @@ def build_call_connection_remove_participant_request( # pylint: disable=name-to _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +408,7 @@ def build_call_connection_mute_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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +443,7 @@ def build_call_connection_cancel_add_participant_request( # pylint: disable=nam _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -471,13 +471,48 @@ def build_call_connection_cancel_add_participant_request( # pylint: disable=nam return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_call_connection_move_participants_request( # pylint: disable=name-too-long + 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", "2026-03-12")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/calling/callConnections/{callConnectionId}/participants:moveHere" + path_format_arguments = { + "callConnectionId": _SERIALIZER.url("call_connection_id", call_connection_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + 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_get_participant_request( # pylint: disable=name-too-long call_connection_id: str, participant_raw_id: str, **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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -503,7 +538,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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -532,7 +567,7 @@ def build_call_media_start_transcription_request( # pylint: disable=name-too-lo _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -561,7 +596,7 @@ def build_call_media_stop_transcription_request( # pylint: disable=name-too-lon _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -590,7 +625,7 @@ def build_call_media_update_transcription_request( # pylint: disable=name-too-l _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -618,7 +653,7 @@ def build_call_media_cancel_all_media_operations_request( # pylint: disable=nam _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -643,7 +678,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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -672,7 +707,7 @@ def build_call_media_start_continuous_dtmf_recognition_request( # pylint: disab _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -701,7 +736,7 @@ def build_call_media_stop_continuous_dtmf_recognition_request( # pylint: disabl _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -728,7 +763,7 @@ def build_call_media_send_dtmf_tones_request(call_connection_id: str, **kwargs: _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -761,7 +796,7 @@ def build_call_media_hold_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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -788,7 +823,7 @@ def build_call_media_unhold_request(call_connection_id: str, **kwargs: Any) -> H _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -817,7 +852,7 @@ def build_call_media_start_media_streaming_request( # pylint: disable=name-too- _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -846,7 +881,7 @@ def build_call_media_stop_media_streaming_request( # pylint: disable=name-too-l _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -873,7 +908,7 @@ def build_call_recording_start_recording_request(**kwargs: Any) -> HttpRequest: _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -902,7 +937,7 @@ def build_call_recording_get_recording_properties_request( # pylint: disable=na _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -928,7 +963,7 @@ def build_call_recording_stop_recording_request( # pylint: disable=name-too-lon _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -954,7 +989,7 @@ def build_call_recording_pause_recording_request( # pylint: disable=name-too-lo _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -980,7 +1015,7 @@ def build_call_recording_resume_recording_request( # pylint: disable=name-too-l _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", "2025-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-12")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1100,7 +1135,10 @@ def create_call( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -1206,7 +1244,10 @@ def answer_call( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -1316,7 +1357,10 @@ def redirect_call( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1418,7 +1462,10 @@ def reject_call( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1519,7 +1566,10 @@ def connect( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -1596,7 +1646,10 @@ def get_call(self, call_connection_id: str, **kwargs: Any) -> _models.CallConnec 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallConnectionProperties", pipeline_response.http_response) @@ -1655,7 +1708,10 @@ def hangup_call( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1708,7 +1764,10 @@ def terminate_call( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -1831,7 +1890,10 @@ def transfer_to_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("TransferCallResponse", pipeline_response.http_response) @@ -1925,7 +1987,10 @@ def get_next(next_link=None): 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -2048,7 +2113,10 @@ def add_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("AddParticipantResponse", pipeline_response.http_response) @@ -2175,7 +2243,10 @@ def remove_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RemoveParticipantResponse", pipeline_response.http_response) @@ -2302,7 +2373,10 @@ def mute( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("MuteParticipantsResult", pipeline_response.http_response) @@ -2429,7 +2503,10 @@ def cancel_add_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CancelAddParticipantResponse", pipeline_response.http_response) @@ -2439,6 +2516,136 @@ def cancel_add_participant( return deserialized # type: ignore + @overload + def move_participants( + self, + call_connection_id: str, + move_participant_request: _models.MoveParticipantsRequest, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Required. + :type move_participant_request: + ~azure.communication.callautomation.models.MoveParticipantsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def move_participants( + self, + call_connection_id: str, + move_participant_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Required. + :type move_participant_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def move_participants( + self, + call_connection_id: str, + move_participant_request: Union[_models.MoveParticipantsRequest, IO[bytes]], + **kwargs: Any, + ) -> _models.MoveParticipantsResponse: + """Add a participant to the call. + + Add a participant to the call. + + :param call_connection_id: The call connection Id. Required. + :type call_connection_id: str + :param move_participant_request: The move participants request. Is either a + MoveParticipantsRequest type or a IO[bytes] type. Required. + :type move_participant_request: + ~azure.communication.callautomation.models.MoveParticipantsRequest or IO[bytes] + :return: MoveParticipantsResponse + :rtype: ~azure.communication.callautomation.models.MoveParticipantsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.MoveParticipantsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move_participant_request, (IOBase, bytes)): + _content = move_participant_request + else: + _json = self._serialize.body(move_participant_request, "MoveParticipantsRequest") + + _request = build_call_connection_move_participants_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) + + deserialized = self._deserialize("MoveParticipantsResponse", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace def get_participant( self, call_connection_id: str, participant_raw_id: str, **kwargs: Any @@ -2489,7 +2696,10 @@ def get_participant( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("CallParticipant", pipeline_response.http_response) @@ -2628,7 +2838,10 @@ def play( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2751,7 +2964,10 @@ def start_transcription( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2874,7 +3090,10 @@ def stop_transcription( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -2997,7 +3216,10 @@ def update_transcription( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3050,7 +3272,10 @@ def cancel_all_media_operations( # pylint: disable=inconsistent-return-statemen 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3169,7 +3394,10 @@ def recognize( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3292,7 +3520,10 @@ def start_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-st 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3415,7 +3646,10 @@ def stop_continuous_dtmf_recognition( # pylint: disable=inconsistent-return-sta 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3537,7 +3771,10 @@ def send_dtmf_tones( 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("SendDtmfTonesResult", pipeline_response.http_response) @@ -3654,7 +3891,10 @@ def hold( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3772,7 +4012,10 @@ def unhold( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -3895,7 +4138,10 @@ def start_media_streaming( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -4018,7 +4264,10 @@ def stop_media_streaming( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -4147,7 +4396,10 @@ def start_recording( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RecordingStateResponse", pipeline_response.http_response) @@ -4202,7 +4454,10 @@ def get_recording_properties(self, recording_id: str, **kwargs: Any) -> _models. 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize("RecordingStateResponse", pipeline_response.http_response) @@ -4259,7 +4514,10 @@ def stop_recording( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -4312,7 +4570,10 @@ def pause_recording( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: @@ -4365,7 +4626,10 @@ def resume_recording( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.CommunicationErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error) if cls: 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 bb363fb18232..419791c3d166 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 +from typing import Dict, List, Optional, Union, TYPE_CHECKING from typing_extensions import Literal from ._generated.models import ( CallLocator, @@ -17,6 +17,9 @@ ChannelAffinity as ChannelAffinityInternal, MediaStreamingSubscription as MediaStreamingSubscriptionInternal, TranscriptionSubscription as TranscriptionSubscriptionInternal, + TeamsPhoneCallDetails as TeamsPhoneCallDetailsInternal, + TeamsPhoneCallerDetails as TeamsPhoneCallerDetailsInternal, + TeamsPhoneSourceDetails as TeamsPhoneSourceDetailsInternal, ) from ._shared.models import ( CommunicationIdentifier, @@ -56,6 +59,7 @@ MuteParticipantsResult as MuteParticipantsResultRest, SendDtmfTonesResult as SendDtmfTonesResultRest, CancelAddParticipantResponse as CancelAddParticipantResultRest, + MoveParticipantsResponse as MoveParticipantsResponseRest, ) @@ -983,3 +987,231 @@ def _from_generated(cls, cancel_add_participant_operation_result_generated: "Can invitation_id=cancel_add_participant_operation_result_generated.invitation_id, operation_context=cancel_add_participant_operation_result_generated.operation_context, ) + +class MoveParticipantsResult: + """The response payload for moving participants to the call. + + :keyword participants: List of current participants in the call. + :paramtype participants: list[~azure.communication.callautomation.CallParticipant] + :keyword operation_context: The operation context provided by client. + :paramtype operation_context: str + :keyword from_call: The CallConnectionId for the call you want to move the participant from. + :paramtype from_call: str + """ + + participants: Optional[List[CallParticipant]] + """List of current participants in the call.""" + operation_context: Optional[str] + """The operation context provided by client.""" + from_call: Optional[str] + """The CallConnectionId for the call you want to move the participant from.""" + + def __init__( + self, + *, + participants: Optional[List[CallParticipant]] = None, + operation_context: Optional[str] = None, + from_call: Optional[str] = None, + ) -> None: + self.participants = participants + self.operation_context = operation_context + self.from_call = from_call + + @classmethod + def _from_generated(cls, move_participants_result_generated: "MoveParticipantsResponseRest"): + participants = None + if move_participants_result_generated.participants: + participants = [ + CallParticipant._from_generated(participant) # pylint:disable=protected-access + for participant in move_participants_result_generated.participants + ] + return cls( + participants=participants, + operation_context=move_participants_result_generated.operation_context, + from_call=move_participants_result_generated.from_call, + ) + +class TeamsPhoneCallDetails: + """The call details which will be sent to the target. + + :keyword teams_phone_caller: Container for details relating to the original caller of the + call. + :paramtype teams_phone_caller: + ~azure.communication.callautomation.models.TeamsPhoneCallerDetails + :keyword teams_phone_source: Container for details relating to the entity responsible for + the creation of these call details. + :paramtype teams_phone_source: + ~azure.communication.callautomation.models.TeamsPhoneSourceDetails + :keyword session_id: Id to exclusively identify this call session. IVR will use this for their + telemetry/reporting. + :paramtype session_id: str + :keyword intent: The intent of the call. + :paramtype intent: str + :keyword call_topic: A very short description (max 48 chars) of the reason for the call. To be + displayed in Teams CallNotification. + :paramtype call_topic: str + :keyword call_context: A summary of the call thus far. It will be displayed on a side panel in the + Teams UI. + :paramtype call_context: str + :keyword transcript_url: Url for fetching the transcript of the call. + :paramtype transcript_url: str + :keyword call_sentiment: Sentiment of the call thus far. + :paramtype call_sentiment: str + :keyword suggested_actions: Recommendations for resolving the issue based on the customer's intent + and interaction history. + :paramtype suggested_actions: str + """ + + teams_phone_caller: Optional["TeamsPhoneCallerDetails"] + """Gets or sets the caller details.""" + teams_phone_source: Optional["TeamsPhoneSourceDetails"] + """Gets or sets the source details.""" + session_id: Optional[str] + """Gets or sets the session id.""" + intent: Optional[str] + """Gets or sets the intent.""" + call_topic: Optional[str] + """Gets or sets the call topic.""" + call_context: Optional[str] + """Gets or sets the call context.""" + transcript_url: Optional[str] + """Gets or sets the transcript url.""" + call_sentiment: Optional[str] + """Gets or sets the call sentiment.""" + suggested_actions: Optional[str] + """Gets or sets the suggested actions.""" + + def __init__(self, *, + teams_phone_caller: Optional["TeamsPhoneCallerDetails"] = None, + teams_phone_source: Optional["TeamsPhoneSourceDetails"] = None, + session_id: Optional[str] = None, + intent: Optional[str] = None, + call_topic: Optional[str] = None, + call_context: Optional[str] = None, + transcript_url: Optional[str] = None, + call_sentiment: Optional[str] = None, + suggested_actions: Optional[str] = None): + self.teams_phone_caller = teams_phone_caller + self.teams_phone_source = teams_phone_source + self.session_id = session_id + self.intent = intent + self.call_topic = call_topic + self.call_context = call_context + self.transcript_url = transcript_url + self.call_sentiment = call_sentiment + self.suggested_actions = suggested_actions + + def _to_generated(self): + return TeamsPhoneCallDetailsInternal( + teams_phone_caller_details=self.teams_phone_caller._to_generated() if self.teams_phone_caller else None, # pylint:disable=protected-access + teams_phone_source_details=self.teams_phone_source._to_generated() if self.teams_phone_source else None, # pylint:disable=protected-access + session_id=self.session_id, + intent=self.intent, + call_topic=self.call_topic, + call_context=self.call_context, + transcript_url=self.transcript_url, + call_sentiment=self.call_sentiment, + suggested_actions=self.suggested_actions + ) + +class TeamsPhoneCallerDetails: + """Container for details relating to the original caller of the call. + + All required parameters must be populated in order to send to server. + + :keyword caller: Caller's ID. Required. + :paramtype caller: ~azure.communication.callautomation.models.CommunicationIdentifierModel + :keyword name: Caller's name. Required. + :paramtype name: str + :keyword phone_number: Caller's phone number. Required. + :paramtype phone_number: str + :keyword record_id: Caller's record ID (ex in CRM). + :paramtype record_id: str + :keyword screen_pop_url: Caller's screen pop URL. + :paramtype screen_pop_url: str + :keyword is_authenticated: Flag indicating whether the caller was authenticated. + :paramtype is_authenticated: bool + :keyword additional_caller_information: A set of key value pairs (max 10, any additional entries + would be ignored) which a bot author wants to pass to the Teams Client for display to the + agent. + :paramtype additional_caller_information: dict[str, str] + """ + + caller: CommunicationIdentifier + name: str + phone_number: str + record_id: Optional[str] = None + screen_pop_url: Optional[str] = None + is_authenticated: Optional[bool] = None + additional_caller_information: Optional[Dict[str, str]] = None + + def __init__( + self, + *, + caller: CommunicationIdentifier, + name: str, + phone_number: str, + record_id: Optional[str] = None, + screen_pop_url: Optional[str] = None, + is_authenticated: Optional[bool] = None, + additional_caller_information: Optional[Dict[str, str]] = None + ) -> None: + self.caller = caller + self.name = name + self.phone_number = phone_number + self.record_id = record_id + self.screen_pop_url = screen_pop_url + self.is_authenticated = is_authenticated + self.additional_caller_information = additional_caller_information + + def _to_generated(self): + return TeamsPhoneCallerDetailsInternal( + caller=serialize_identifier(self.caller), + name=self.name, + phone_number=self.phone_number, + record_id=self.record_id, + screen_pop_url=self.screen_pop_url, + is_authenticated=self.is_authenticated, + additional_caller_information=self.additional_caller_information + ) + +class TeamsPhoneSourceDetails: + """Container for details relating to the entity responsible for the creation of these call + details. + + All required parameters must be populated in order to send to server. + + :keyword source: ID of the source entity passing along the call details (ex. Application Instance + ID of - CQ/AA). Required. + :paramtype source: ~azure.communication.callautomation.CommunicationIdentifier + :keyword language: Language of the source entity passing along the call details, passed in the + ISO-639 standard. Required. + :paramtype language: str + :keyword status: Status of the source entity passing along the call details. Required. + :paramtype status: str + :keyword intended_targets: Intended targets of the source entity passing along the call details. + :paramtype intended_targets: dict[str, + ~azure.communication.callautomation.CommunicationIdentifier] + """ + + def __init__( + self, + *, + source: CommunicationIdentifier, + language: str, + status: str, + intended_targets: Optional[Dict[str, CommunicationIdentifier]] = None + ) -> None: + self.source = source + self.language = language + self.status = status + self.intended_targets = intended_targets + + def _to_generated(self): + return TeamsPhoneSourceDetailsInternal( + source=serialize_identifier(self.source), + language=self.language, + status=self.status, + intended_targets={k: serialize_identifier(v) for k, v in self.intended_targets.items()} + if self.intended_targets else None + ) 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 6d851960b453..afb4e6136dcd 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.5.0" +VERSION = "1.6.0" SDK_MONIKER = f"communication-callautomation/{format(VERSION)}" 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 9ddbd7e0af75..62dfb0574b24 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines, disable=line-too-long, disable=too-many-locals # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -31,6 +31,8 @@ FileSource, TextSource, SsmlSource, + MoveParticipantsResult, + TeamsPhoneCallDetails, ) from .._generated.aio import AzureCommunicationCallAutomationService from .._generated.models import ( @@ -57,6 +59,7 @@ UnholdRequest, StartMediaStreamingRequest, StopMediaStreamingRequest, + MoveParticipantsRequest, ) from .._generated.models._enums import RecognizeInputType from .._shared.auth_policy_utils import get_authentication_policy @@ -232,6 +235,7 @@ async def transfer_call_to_participant( sip_headers: Optional[Mapping[str, str]] = None, voip_headers: Optional[Mapping[str, str]] = None, source_caller_id_number: Optional["PhoneNumberIdentifier"] = None, + teams_phone_call_details: Optional[TeamsPhoneCallDetails] = None, **kwargs, ) -> TransferCallResult: """Transfer this call to another participant. @@ -254,6 +258,8 @@ async def transfer_call_to_participant( :keyword source_caller_id_number: The source caller Id, a phone number, that's will be used as the transferor's(Contoso) caller id when transfering a call a pstn target. :paramtype source_caller_id_number: ~azure.communication.callautomation.PhoneNumberIdentifier or None + :keyword teams_phone_call_details: Teams phone call details for the transfer. + :paramtype teams_phone_call_details: ~azure.communication.callautomation.TeamsPhoneCallDetails or None :return: TransferCallResult :rtype: ~azure.communication.callautomation.TransferCallResult :raises ~azure.core.exceptions.HttpResponseError: @@ -262,6 +268,7 @@ async def transfer_call_to_participant( user_custom_context: Optional[CustomCallingContext] = CustomCallingContext( voip_headers=dict(voip_headers) if voip_headers is not None else None, sip_headers=dict(sip_headers) if sip_headers is not None else None, + teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None, # pylint:disable=protected-access ) else: user_custom_context = None @@ -290,6 +297,7 @@ async def add_participant( operation_callback_url: Optional[str] = None, sip_headers: Optional[Mapping[str, str]] = None, voip_headers: Optional[Mapping[str, str]] = None, + teams_phone_call_details: Optional["TeamsPhoneCallDetails"] = None, **kwargs, ) -> AddParticipantResult: """Add a participant to this call. @@ -316,6 +324,8 @@ async def add_participant( :paramtype sip_headers: Dict[str, str] or None :keyword voip_headers: Voip Headers for Voip Call :paramtype voip_headers: Dict[str, str] or None + :keyword teams_phone_call_details: Teams phone call details for the participant being added. + :paramtype teams_phone_call_details: ~azure.communication.callautomation.TeamsPhoneCallDetails or None :return: AddParticipantResult :rtype: ~azure.communication.callautomation.AddParticipantResult :raises ~azure.core.exceptions.HttpResponseError: @@ -330,6 +340,7 @@ async def add_participant( user_custom_context: Optional[CustomCallingContext] = CustomCallingContext( voip_headers=dict(voip_headers) if voip_headers is not None else None, sip_headers=dict(sip_headers) if sip_headers is not None else None, + teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details else None, # pylint:disable=protected-access ) else: user_custom_context = None @@ -384,6 +395,46 @@ async def remove_participant( return RemoveParticipantResult._from_generated(response) # pylint:disable=protected-access + @distributed_trace_async + async def move_participants( + self, + target_participants: List["CommunicationIdentifier"], + from_call: str, + *, + operation_context: Optional[str] = None, + operation_callback_url: Optional[str] = None, + **kwargs, + ) -> MoveParticipantsResult: + """Move participants from another call to this call. + + :param target_participants: The participants to move to this call. + :type target_participants: list[~azure.communication.callautomation.CommunicationIdentifier] + :param from_call: The CallConnectionId for the call you want to move the participant from. + :type from_call: str + :keyword operation_context: Value that can be used to track this call and its associated events. + :paramtype operation_context: str + :keyword operation_callback_url: Set a callback URL that overrides the default callback URL set + by CreateCall/AnswerCall for this operation. + This setup is per-action. If this is not set, the default callback URL set by + CreateCall/AnswerCall will be used. + :paramtype operation_callback_url: str or None + :return: MoveParticipantsResult + :rtype: ~azure.communication.callautomation.MoveParticipantsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + move_participants_request = MoveParticipantsRequest( + target_participants=[serialize_identifier(participant) for participant in target_participants], + from_call=from_call, + operation_context=operation_context, + operation_callback_uri=operation_callback_url, + ) + process_repeatability_first_sent(kwargs) + response = await self._call_connection_client.move_participants( + self._call_connection_id, move_participants_request, **kwargs + ) + + return MoveParticipantsResult._from_generated(response) # pylint:disable=protected-access + @overload async def play_media( self, diff --git a/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md b/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md index 330acd5064ca..f0b54c15792b 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-2025-06-15 -require: https://github.com/Azure/azure-rest-api-specs/blob/b359b43e76ee17d4f1c5aa83b58577653c0fb51b/specification/communication/data-plane/CallAutomation/readme.md +tag: package-2026-03-12 +require: https://github.com/Azure/azure-rest-api-specs/blob/19a64af9a1a6fc59298aeffc8c2c48e097ef279d/specification/communication/data-plane/CallAutomation/readme.md output-folder: ../azure/communication/callautomation/_generated models-mode: msrest namespace: azure.communication.callautomation