Skip to content

Commit fefc834

Browse files
committed
updating ga5 version
1 parent 803cfcf commit fefc834

29 files changed

+1083
-5143
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
RecordingContent,
4444
RecordingChannel,
4545
RecordingFormat,
46+
RecordingKind,
4647
RecordingStorageKind,
4748
RecognizeInputType,
4849
MediaStreamingAudioChannelType,
4950
MediaStreamingContentType,
50-
MediaStreamingTransportType,
51-
TranscriptionTransportType,
51+
StreamingTransportType,
5252
DtmfTone,
5353
CallConnectionState,
5454
RecordingState,
@@ -97,12 +97,12 @@
9797
"RecordingContent",
9898
"RecordingChannel",
9999
"RecordingFormat",
100+
"RecordingKind",
100101
"RecordingStorageKind",
101102
"RecognizeInputType",
102103
"MediaStreamingAudioChannelType",
103104
"MediaStreamingContentType",
104-
"MediaStreamingTransportType",
105-
"TranscriptionTransportType",
105+
"StreamingTransportType",
106106
"DtmfTone",
107107
"CallConnectionState",
108108
"RecordingState",
@@ -137,6 +137,14 @@ def __getattr__(name):
137137
from ._models import ServerCallLocator
138138

139139
return ServerCallLocator
140+
if name == "RoomCallLocator":
141+
warnings.warn(
142+
"RoomCallLocator is deprecated and should not be used. Please pass in 'room_id' directly.",
143+
DeprecationWarning,
144+
)
145+
from ._models import RoomCallLocator
146+
147+
return RoomCallLocator
140148
if name == "MicrosoftBotIdentifier":
141149
warnings.warn(
142150
f"{name} is deprecated and should not be used. Please use 'MicrosoftTeamsAppIdentifier' instead.",

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99

1010
class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
1111
V2023_03_06 = "2023-03-06"
12-
V2023_06_15_PREVIEW = "2023-06-15-preview"
1312
V2023_10_15 = "2023-10-15"
14-
V2023_10_03_PREVIEW = "2023-10-03-preview"
1513
V2024_04_15 = "2024-04-15"
16-
V2024_06_15_PREVIEW = "2024-06-15-preview"
1714
V2024_09_15 = "2024-09-15"
18-
V2024_11_15_PREVIEW = "2024-11-15-preview"
19-
V2024_09_01_PREVIEW = "2024-09-01-preview"
15+
V2025_05_15 = "2025-05-15"
2016

21-
DEFAULT_VERSION = ApiVersion.V2024_09_01_PREVIEW.value
17+
DEFAULT_VERSION = ApiVersion.V2025_05_15.value

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

Lines changed: 14 additions & 153 deletions
Large diffs are not rendered by default.

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

Lines changed: 12 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,10 @@
5050
UnholdRequest,
5151
StartMediaStreamingRequest,
5252
StopMediaStreamingRequest,
53-
InterruptAudioAndAnnounceRequest,
5453
)
5554
from ._generated.models._enums import RecognizeInputType
5655
from ._shared.auth_policy_utils import get_authentication_policy
5756
from ._shared.utils import parse_connection_str
58-
from ._credential.call_automation_auth_policy_utils import get_call_automation_auth_policy
59-
from ._credential.credential_utils import get_custom_enabled, get_custom_url
6057

6158
if TYPE_CHECKING:
6259
from ._call_automation_client import CallAutomationClient
@@ -103,26 +100,14 @@ def __init__(
103100
if not parsed_url.netloc:
104101
raise ValueError(f"Invalid URL: {format(endpoint)}")
105102

106-
custom_enabled = get_custom_enabled()
107-
custom_url = get_custom_url()
108-
if custom_enabled and custom_url is not None:
109-
self._client = AzureCommunicationCallAutomationService(
110-
custom_url,
111-
credential,
112-
api_version=api_version or DEFAULT_VERSION,
113-
authentication_policy=get_call_automation_auth_policy(custom_url, credential, acs_url=endpoint),
114-
sdk_moniker=SDK_MONIKER,
115-
**kwargs,
116-
)
117-
else:
118-
self._client = AzureCommunicationCallAutomationService(
119-
endpoint,
120-
credential,
121-
api_version=api_version or DEFAULT_VERSION,
122-
authentication_policy=get_authentication_policy(endpoint, credential),
123-
sdk_moniker=SDK_MONIKER,
124-
**kwargs,
125-
)
103+
self._client = AzureCommunicationCallAutomationService(
104+
endpoint,
105+
credential,
106+
api_version=api_version or DEFAULT_VERSION,
107+
authentication_policy=get_authentication_policy(endpoint, credential),
108+
sdk_moniker=SDK_MONIKER,
109+
**kwargs,
110+
)
126111
else:
127112
self._client = call_automation_client
128113

@@ -384,7 +369,6 @@ def play_media(
384369
loop: bool = False,
385370
operation_context: Optional[str] = None,
386371
operation_callback_url: Optional[str] = None,
387-
interrupt_hold_audio : bool = False,
388372
**kwargs
389373
) -> None:
390374
"""Play media to specific participant(s) in this call.
@@ -408,9 +392,6 @@ def play_media(
408392
This setup is per-action. If this is not set, the default callback URL set by
409393
CreateCall/AnswerCall will be used.
410394
:paramtype operation_callback_url: str or None
411-
:keyword interrupt_hold_audio: If set, hold audio will be interrupted, then this request will be
412-
played, and then the hold audio will be resumed.
413-
:paramtype interrupt_hold_audio: bool
414395
:return: None
415396
:rtype: None
416397
:raises ~azure.core.exceptions.HttpResponseError:
@@ -514,7 +495,6 @@ def _play_media(
514495
operation_context: Optional[str] = None,
515496
operation_callback_url: Optional[str] = None,
516497
interrupt_call_media_operation: Optional[bool] = False,
517-
interrupt_hold_audio : bool = False,
518498
**kwargs
519499
) -> None:
520500
"""Play media to specific participant(s) in this call.
@@ -541,9 +521,6 @@ def _play_media(
541521
:keyword interrupt_call_media_operation: If set play can barge into other existing
542522
queued-up/currently-processing requests.
543523
:paramtype interrupt_call_media_operation: bool
544-
:keyword interrupt_hold_audio: If set, hold audio will be interrupted, then this request will be
545-
played, and then the hold audio will be resumed.
546-
:paramtype interrupt_hold_audio: bool
547524
:return: None
548525
:rtype: None
549526
:raises ~azure.core.exceptions.HttpResponseError:
@@ -558,13 +535,12 @@ def _play_media(
558535

559536
audience = [] if play_to == "all" else [serialize_identifier(i) for i in play_to]
560537
interrupt_call_media_operation = interrupt_call_media_operation if play_to == "all" else False
561-
interrupt_hold_audio = interrupt_hold_audio if play_to != "all" else False
562538
play_request = PlayRequest(
563539
play_sources=[play_source_single._to_generated()] if play_source_single else # pylint:disable=protected-access
564540
[source._to_generated() for source in play_sources] if play_sources else None, # pylint:disable=protected-access
565541
play_to=audience,
566-
play_options=PlayOptions(loop=loop,interrupt_call_media_operation=interrupt_call_media_operation,
567-
interrupt_hold_audio=interrupt_hold_audio),
542+
play_options=PlayOptions(loop=loop),
543+
interrupt_call_media_operation=interrupt_call_media_operation,
568544
operation_context=operation_context,
569545
operation_callback_uri=operation_callback_url,
570546
**kwargs,
@@ -634,12 +610,11 @@ def start_recognizing_media(
634610
interrupt_prompt: bool = False,
635611
dtmf_inter_tone_timeout: Optional[int] = None,
636612
dtmf_max_tones_to_collect: Optional[int] = None,
637-
dtmf_stop_tones: Optional[List[str or "DtmfTone"]] = None,
613+
dtmf_stop_tones: Optional[List[Union[str, "DtmfTone"]]] = None,
638614
speech_language: Optional[str] = None,
639615
choices: Optional[List["RecognitionChoice"]] = None,
640616
end_silence_timeout: Optional[int] = None,
641617
speech_recognition_model_endpoint_id: Optional[str] = None,
642-
operation_callback_url: Optional[str] = None,
643618
**kwargs,
644619
) -> None:
645620
"""Recognize inputs from specific participant in this call.
@@ -762,7 +737,6 @@ def start_continuous_dtmf_recognition(
762737
target_participant: "CommunicationIdentifier",
763738
*,
764739
operation_context: Optional[str] = None,
765-
operation_callback_url: Optional[str] = None,
766740
**kwargs,
767741
) -> None:
768742
"""Start continuous Dtmf recognition by subscribing to tones.
@@ -771,19 +745,13 @@ def start_continuous_dtmf_recognition(
771745
:type target_participant: ~azure.communication.callautomation.CommunicationIdentifier
772746
:keyword operation_context: The value to identify context of the operation.
773747
:paramtype operation_context: str
774-
:keyword operation_callback_url: Set a callback URL that overrides the default callback URL set
775-
by CreateCall/AnswerCall for this operation.
776-
This setup is per-action. If this is not set, the default callback URL set by
777-
CreateCall/AnswerCall will be used.
778-
:paramtype operation_callback_url: str or None
779748
:return: None
780749
:rtype: None
781750
:raises ~azure.core.exceptions.HttpResponseError:
782751
"""
783752
continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest(
784753
target_participant=serialize_identifier(target_participant),
785754
operation_context=operation_context,
786-
operation_callback_uri=operation_callback_url,
787755
)
788756
self._call_media_client.start_continuous_dtmf_recognition(
789757
self._call_connection_id, continuous_dtmf_recognition_request, **kwargs
@@ -1144,46 +1112,9 @@ def stop_media_streaming(
11441112
stop_media_streaming_request=StopMediaStreamingRequest(
11451113
operation_callback_uri=operation_callback_url,
11461114
operation_context=operation_context
1147-
)
1115+
)
11481116
self._call_media_client.stop_media_streaming(
11491117
self._call_connection_id,
11501118
stop_media_streaming_request,
11511119
**kwargs
1152-
)
1153-
1154-
@distributed_trace
1155-
def interrupt_audio_and_announce(
1156-
self,
1157-
target_participant: "CommunicationIdentifier",
1158-
play_sources: List[Union['FileSource', 'TextSource', 'SsmlSource']],
1159-
*,
1160-
operation_context: Optional[str] = None,
1161-
**kwargs,
1162-
) -> None:
1163-
"""Interrupt audio and announce to specific participant(s) in this call.
1164-
1165-
:param target_participant: The participant being added.
1166-
:type target_participant: ~azure.communication.callautomation.CommunicationIdentifier
1167-
:param play_sources: A PlaySource representing the source to play.
1168-
:type play_sources: list[~azure.communication.callautomation.FileSource] or
1169-
list[~azure.communication.callautomation.TextSource] or
1170-
list[~azure.communication.callautomation.SsmlSource]
1171-
:keyword operation_context: Value that can be used to track this call and its associated events.
1172-
:paramtype operation_context: str or None
1173-
:return: None
1174-
:rtype: None
1175-
:raises ~azure.core.exceptions.HttpResponseError:
1176-
"""
1177-
1178-
interrupt_audio_announce_request = InterruptAudioAndAnnounceRequest(
1179-
play_sources=[source._to_generated() for source in play_sources] if play_sources else None, # pylint: disable=protected-access
1180-
play_to=serialize_identifier(target_participant),
1181-
operation_context=operation_context,
1182-
kwargs=kwargs,
11831120
)
1184-
1185-
self._call_media_client.interrupt_audio_and_announce(
1186-
self._call_connection_id,
1187-
interrupt_audio_announce_request,
1188-
**kwargs
1189-
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from azure.core.utils import case_insensitive_dict
2121

2222
from ._generated import models as _models
23-
from ._generated._serialization import Serializer
23+
from ._generated._utils.serialization import Serializer
2424
from ._generated.operations import CallRecordingOperations
2525

2626
_SERIALIZER = Serializer()

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_credential/call_automation_policy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class CallAutomationHMACCredentialsPolicy(SansIOHTTPPolicy):
2626

2727
def __init__(
2828
self,
29-
host, # type: str
30-
acs_url, # type: str
31-
access_key, # type: Union[str, AzureKeyCredential]
32-
decode_url=False, # type: bool
29+
host: str,
30+
acs_url: str,
31+
access_key: Union[str, AzureKeyCredential],
32+
decode_url: bool = False,
3333
):
3434
# type: (...) -> None
3535
super(CallAutomationHMACCredentialsPolicy, self).__init__()

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717

1818
from . import models as _models
1919
from ._configuration import AzureCommunicationCallAutomationServiceConfiguration
20-
from ._serialization import Deserializer, Serializer
20+
from ._utils.serialization import Deserializer, Serializer
2121
from .operations import (
2222
AzureCommunicationCallAutomationServiceOperationsMixin,
2323
CallConnectionOperations,
24-
CallDialogOperations,
2524
CallMediaOperations,
2625
CallRecordingOperations,
2726
)
@@ -35,16 +34,14 @@ class AzureCommunicationCallAutomationService(AzureCommunicationCallAutomationSe
3534
azure.communication.callautomation.operations.CallConnectionOperations
3635
:ivar call_media: CallMediaOperations operations
3736
:vartype call_media: azure.communication.callautomation.operations.CallMediaOperations
38-
:ivar call_dialog: CallDialogOperations operations
39-
:vartype call_dialog: azure.communication.callautomation.operations.CallDialogOperations
4037
:ivar call_recording: CallRecordingOperations operations
4138
:vartype call_recording: azure.communication.callautomation.operations.CallRecordingOperations
4239
:param endpoint: The endpoint of the Azure Communication resource. Required.
4340
:type endpoint: str
4441
:param credential: Credential needed for the client to connect to Azure. Required.
4542
:type credential: ~azure.core.credentials.AzureKeyCredential
46-
:keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding
47-
this default value may result in unsupported behavior.
43+
:keyword api_version: Api Version. Default value is "2025-05-15". Note that overriding this
44+
default value may result in unsupported behavior.
4845
:paramtype api_version: str
4946
"""
5047

@@ -53,6 +50,7 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
5350
self._config = AzureCommunicationCallAutomationServiceConfiguration(
5451
endpoint=endpoint, credential=credential, **kwargs
5552
)
53+
5654
_policies = kwargs.pop("policies", None)
5755
if _policies is None:
5856
_policies = [
@@ -79,7 +77,6 @@ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
7977
self._serialize.client_side_validation = False
8078
self.call_connection = CallConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
8179
self.call_media = CallMediaOperations(self._client, self._config, self._serialize, self._deserialize)
82-
self.call_dialog = CallDialogOperations(self._client, self._config, self._serialize, self._deserialize)
8380
self.call_recording = CallRecordingOperations(self._client, self._config, self._serialize, self._deserialize)
8481

8582
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class AzureCommunicationCallAutomationServiceConfiguration: # pylint: disable=t
2525
:type endpoint: str
2626
:param credential: Credential needed for the client to connect to Azure. Required.
2727
:type credential: ~azure.core.credentials.AzureKeyCredential
28-
:keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding
29-
this default value may result in unsupported behavior.
28+
:keyword api_version: Api Version. Default value is "2025-05-15". Note that overriding this
29+
default value may result in unsupported behavior.
3030
:paramtype api_version: str
3131
"""
3232

3333
def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None:
34-
api_version: str = kwargs.pop("api_version", "2024-09-01-preview")
34+
api_version: str = kwargs.pop("api_version", "2025-05-15")
3535

3636
if endpoint is None:
3737
raise ValueError("Parameter 'endpoint' must not be None.")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_serialization.py renamed to sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_utils/serialization.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# pylint: disable=line-too-long,useless-suppression,too-many-lines
2+
# coding=utf-8
23
# --------------------------------------------------------------------------
3-
#
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
268
# --------------------------------------------------------------------------
279

2810
# pyright: reportUnnecessaryTypeIgnoreComment=false
@@ -411,7 +393,7 @@ def from_dict(
411393
:param function key_extractors: A key extractor function.
412394
:param str content_type: JSON by default, set application/xml if XML.
413395
:returns: An instance of this model
414-
:raises: DeserializationError if something went wrong
396+
:raises DeserializationError: if something went wrong
415397
:rtype: Self
416398
"""
417399
deserializer = Deserializer(cls._infer_class_models())

0 commit comments

Comments
 (0)