Skip to content

Commit f92050b

Browse files
committed
updating the changelog and other changes
1 parent a400c80 commit f92050b

File tree

12 files changed

+352
-110
lines changed

12 files changed

+352
-110
lines changed

sdk/communication/azure-communication-callautomation/azure/apiview-properties.json

Lines changed: 217 additions & 0 deletions
Large diffs are not rendered by default.

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(
113113
api_version=api_version or DEFAULT_VERSION,
114114
authentication_policy=get_authentication_policy(endpoint, credential),
115115
sdk_moniker=SDK_MONIKER,
116-
**kwargs
116+
**kwargs,
117117
)
118118

119119
self._call_recording_client = self._client.call_recording

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# pylint: disable=too-many-lines
1+
# pylint: disable=too-many-lines, disable=line-too-long, disable=too-many-locals
22
# -------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
from re import S
87
from typing import TYPE_CHECKING, Mapping, Optional, List, Sequence, Union, cast, overload
98
from urllib.parse import urlparse
109
import warnings
@@ -62,7 +61,7 @@
6261
UnholdRequest,
6362
StartMediaStreamingRequest,
6463
StopMediaStreamingRequest,
65-
SummarizeCallRequest
64+
SummarizeCallRequest,
6665
)
6766
from ._generated.models._enums import RecognizeInputType
6867
from ._shared.auth_policy_utils import get_authentication_policy
@@ -272,7 +271,7 @@ def transfer_call_to_participant(
272271
user_custom_context: Optional[CustomCallingContext] = CustomCallingContext(
273272
voip_headers=dict(voip_headers) if voip_headers is not None else None,
274273
sip_headers=dict(sip_headers) if sip_headers is not None else None,
275-
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None,
274+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None, # pylint:disable=protected-access
276275
)
277276
else:
278277
user_custom_context = None
@@ -345,7 +344,7 @@ def add_participant(
345344
user_custom_context: Optional[CustomCallingContext] = CustomCallingContext(
346345
voip_headers=dict(voip_headers) if voip_headers is not None else None,
347346
sip_headers=dict(sip_headers) if sip_headers is not None else None,
348-
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None,
347+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details is not None else None, # pylint:disable=protected-access
349348
)
350349
else:
351350
user_custom_context = None
@@ -403,7 +402,7 @@ def remove_participant(
403402
@distributed_trace
404403
def move_participants(
405404
self,
406-
target_participants: List["CommunicationIdentifier"],
405+
target_participants: Sequence["CommunicationIdentifier"],
407406
from_call: str,
408407
*,
409408
operation_context: Optional[str] = None,
@@ -428,7 +427,7 @@ def move_participants(
428427
:raises ~azure.core.exceptions.HttpResponseError:
429428
"""
430429
move_participants_request = MoveParticipantsRequest(
431-
target_participants=[serialize_identifier(participant) for participant in target_participants],
430+
target_participants=[serialize_identifier(p) for p in target_participants],
432431
from_call=from_call,
433432
operation_context=operation_context,
434433
operation_callback_uri=operation_callback_url,
@@ -760,12 +759,20 @@ def start_recognizing_media(
760759
:rtype: None
761760
:raises ~azure.core.exceptions.HttpResponseError:
762761
"""
762+
speech_language_single: Optional[str] = None
763+
speech_languages: Optional[List[str]] = None
764+
if isinstance(speech_language, str):
765+
speech_language_single = speech_language
766+
else:
767+
speech_languages = list(speech_language) if speech_language is not None else None
763768
options = RecognizeOptions(
764769
interrupt_prompt=interrupt_prompt,
765770
initial_silence_timeout_in_seconds=initial_silence_timeout,
766771
target_participant=serialize_identifier(target_participant),
767772
speech_recognition_model_endpoint_id=speech_recognition_model_endpoint_id,
768-
enable_sentiment_analysis= enable_sentiment_analysis,
773+
enable_sentiment_analysis=enable_sentiment_analysis,
774+
speech_language=speech_language_single,
775+
speech_languages=speech_languages,
769776
)
770777
play_prompt_single: Optional[PlaySource] = None
771778
play_prompts: Optional[List[PlaySource]] = None
@@ -807,11 +814,9 @@ def start_recognizing_media(
807814
recognize_input_type=input_type,
808815
play_prompt=play_prompt_single,
809816
play_prompts=play_prompts,
810-
speech_languages=speech_language if isinstance(speech_language, list) else None,
811817
interrupt_call_media_operation=interrupt_call_media_operation,
812818
operation_context=operation_context,
813819
recognize_options=options,
814-
speech_language=speech_language if not isinstance(speech_language, list) else None,
815820
operation_callback_uri=operation_callback_url,
816821
)
817822
self._call_media_client.recognize(self._call_connection_id, recognize_request, **kwargs)
@@ -997,7 +1002,7 @@ def start_transcription(
9971002
9981003
:keyword locale: Defines Locale for the transcription e,g en-US.
9991004
List of languages for Language Identification.
1000-
:paramtype locale: str or Sequence[str]
1005+
:paramtype locale: str or List[str]
10011006
:keyword operation_context: The value to identify context of the operation.
10021007
:paramtype operation_context: str
10031008
:keyword speech_recognition_model_endpoint_id: Endpoint where the custom model was deployed.
@@ -1019,14 +1024,20 @@ def start_transcription(
10191024
:raises ~azure.core.exceptions.HttpResponseError:
10201025
"""
10211026

1027+
locale_single: Optional[str] = None
1028+
locales: Optional[List[str]] = None
1029+
if isinstance(locale, str):
1030+
locale_single = locale
1031+
else:
1032+
locales = list(locale) if locale is not None else None
10221033
start_transcription_request = StartTranscriptionRequest(
1023-
locale=locale if not isinstance(locale, list) else None,
1034+
locale=locale_single,
10241035
operation_context=operation_context,
10251036
speech_recognition_model_endpoint_id=speech_recognition_model_endpoint_id,
10261037
operation_callback_uri=operation_callback_url,
10271038
pii_redaction_options=pii_redaction._to_generated() if pii_redaction else None, # pylint:disable=protected-access
10281039
enable_sentiment_analysis=enable_sentiment_analysis,
1029-
locales=locale if isinstance(locale, list) else None,
1040+
locales=locales,
10301041
summarization_options=summarization._to_generated() if summarization else None, # pylint:disable=protected-access
10311042
**kwargs
10321043
)

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
7171
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
7272

7373
client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)}
74-
client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)})
74+
client_models |= {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
7575
self._serialize = Serializer(client_models)
7676
self._deserialize = Deserializer(client_models)
7777
self._serialize.client_side_validation = False

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import sys
2222
import codecs
2323
from typing import (
24-
Dict,
2524
Any,
2625
cast,
2726
Optional,
@@ -31,7 +30,6 @@
3130
Mapping,
3231
Callable,
3332
MutableMapping,
34-
List,
3533
)
3634

3735
try:
@@ -229,12 +227,12 @@ class Model:
229227
serialization and deserialization.
230228
"""
231229

232-
_subtype_map: Dict[str, Dict[str, Any]] = {}
233-
_attribute_map: Dict[str, Dict[str, Any]] = {}
234-
_validation: Dict[str, Dict[str, Any]] = {}
230+
_subtype_map: dict[str, dict[str, Any]] = {}
231+
_attribute_map: dict[str, dict[str, Any]] = {}
232+
_validation: dict[str, dict[str, Any]] = {}
235233

236234
def __init__(self, **kwargs: Any) -> None:
237-
self.additional_properties: Optional[Dict[str, Any]] = {}
235+
self.additional_properties: Optional[dict[str, Any]] = {}
238236
for k in kwargs: # pylint: disable=consider-using-dict-items
239237
if k not in self._attribute_map:
240238
_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:
311309
def as_dict(
312310
self,
313311
keep_readonly: bool = True,
314-
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
312+
key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer,
315313
**kwargs: Any
316314
) -> JSON:
317315
"""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:
380378
def from_dict(
381379
cls,
382380
data: Any,
383-
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
381+
key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None,
384382
content_type: Optional[str] = None,
385383
) -> Self:
386384
"""Parse a dict using given key extractor return a model.
@@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects):
414412
return {}
415413
result = dict(cls._subtype_map[key])
416414
for valuetype in cls._subtype_map[key].values():
417-
result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
415+
result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access
418416
return result
419417

420418
@classmethod
@@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
528526
"[]": self.serialize_iter,
529527
"{}": self.serialize_dict,
530528
}
531-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
529+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
532530
self.key_transformer = full_restapi_key_transformer
533531
self.client_side_validation = True
534532

@@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to
579577

580578
if attr_name == "additional_properties" and attr_desc["key"] == "":
581579
if target_obj.additional_properties is not None:
582-
serialized.update(target_obj.additional_properties)
580+
serialized |= target_obj.additional_properties
583581
continue
584582
try:
585583

@@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen
11841182

11851183
while "." in key:
11861184
# Need the cast, as for some reasons "split" is typed as list[str | Any]
1187-
dict_keys = cast(List[str], _FLATTEN.split(key))
1185+
dict_keys = cast(list[str], _FLATTEN.split(key))
11881186
if len(dict_keys) == 1:
11891187
key = _decode_attribute_map_key(dict_keys[0])
11901188
break
@@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
13861384
"duration": (isodate.Duration, datetime.timedelta),
13871385
"iso-8601": (datetime.datetime),
13881386
}
1389-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
1387+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
13901388
self.key_extractors = [rest_key_extractor, xml_key_extractor]
13911389
# Additional properties only works if the "rest_key_extractor" is used to
13921390
# extract the keys. Making it to work whatever the key extractor is too much

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
7272
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
7373

7474
client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)}
75-
client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)})
75+
client_models |= {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
7676
self._serialize = Serializer(client_models)
7777
self._deserialize = Deserializer(client_models)
7878
self._serialize.client_side_validation = False

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/operations/_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# --------------------------------------------------------------------------
99
from collections.abc import MutableMapping
1010
from io import IOBase
11-
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
11+
from typing import Any, Callable, IO, Optional, TypeVar, Union, overload
1212
import urllib.parse
1313

1414
from azure.core import AsyncPipelineClient
@@ -70,7 +70,7 @@
7070
from .._configuration import AzureCommunicationCallAutomationServiceConfiguration
7171

7272
T = TypeVar("T")
73-
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
73+
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]]
7474

7575

7676
class _AzureCommunicationCallAutomationServiceOperationsMixin(

0 commit comments

Comments
 (0)