Skip to content

Commit 8468286

Browse files
author
Vinothini Dharmaraj
committed
updating the update transcription and media streaming
1 parent dc8ac56 commit 8468286

9 files changed

+78
-14
lines changed

sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ protected CallMedia() { }
370370
public virtual Azure.Response Unhold(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
371371
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
372372
public virtual System.Threading.Tasks.Task<Azure.Response> UnholdAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
373-
public virtual Azure.Response UpdateTranscription(string locale, string speechRecognitionModelEndpointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
373+
public virtual Azure.Response UpdateTranscription(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
374374
public virtual Azure.Response UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
375-
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(string locale, string speechRecognitionModelEndpointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
375+
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
376376
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTranscriptionAsync(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
377377
}
378378
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
@@ -1367,6 +1367,7 @@ public partial class StopMediaStreamingOptions
13671367
{
13681368
public StopMediaStreamingOptions() { }
13691369
public System.Uri OperationCallbackUri { get { throw null; } set { } }
1370+
public string OperationContext { get { throw null; } set { } }
13701371
}
13711372
public partial class StopTranscriptionOptions
13721373
{
@@ -1609,6 +1610,12 @@ public UnholdOptions(Azure.Communication.CommunicationIdentifier targetParticipa
16091610
public string OperationContext { get { throw null; } set { } }
16101611
public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } }
16111612
}
1613+
public partial class UpdateTranscriptionOptions
1614+
{
1615+
public UpdateTranscriptionOptions(string locale) { }
1616+
public string OperationContext { get { throw null; } set { } }
1617+
public string SpeechRecognitionModelEndpointId { get { throw null; } set { } }
1618+
}
16121619
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
16131620
public readonly partial struct VoiceKind : System.IEquatable<Azure.Communication.CallAutomation.VoiceKind>
16141621
{

sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,17 +1382,21 @@ public virtual Response UpdateTranscription(string locale, CancellationToken can
13821382
/// <summary>
13831383
/// API to change transcription language.
13841384
/// </summary>
1385-
/// <param name="locale">Defines new locale for transcription.</param>
1386-
/// <param name="speechRecognitionModelEndpointId">Sets Endpoint id where the custom model was deployed.</param>
1385+
/// <param name="options">An optional object containing update transcription options and configurations.</param>
13871386
/// <param name="cancellationToken">An optional CancellationToken to cancel the request.</param>
13881387
/// <returns>Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error.</returns>
1389-
public virtual Response UpdateTranscription(string locale, string speechRecognitionModelEndpointId, CancellationToken cancellationToken = default)
1388+
public virtual Response UpdateTranscription(UpdateTranscriptionOptions options = default, CancellationToken cancellationToken = default)
13901389
{
13911390
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UpdateTranscription)}");
13921391
scope.Start();
13931392
try
13941393
{
1395-
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(locale) { SpeechRecognitionModelEndpointId = speechRecognitionModelEndpointId };
1394+
UpdateTranscriptionRequestInternal request = new(options.Locale)
1395+
{
1396+
OperationContext = options.OperationContext,
1397+
SpeechRecognitionModelEndpointId = options.SpeechRecognitionModelEndpointId
1398+
};
1399+
13961400
return CallMediaRestClient.UpdateTranscription(CallConnectionId, request, cancellationToken);
13971401
}
13981402
catch (Exception ex)
@@ -1427,17 +1431,21 @@ public virtual async Task<Response> UpdateTranscriptionAsync(string locale, Canc
14271431
/// <summary>
14281432
/// API to change transcription language.
14291433
/// </summary>
1430-
/// <param name="locale">Defines new locale for transcription.</param>
1431-
/// <param name="speechRecognitionModelEndpointId">Sets Endpoint id where the custom model was deployed.</param>
1434+
/// <param name="options">An optional object containing update transcription options and configurations.</param>
14321435
/// <param name="cancellationToken">An optional CancellationToken to cancel the request.</param>
14331436
/// <returns>Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error.</returns>
1434-
public virtual async Task<Response> UpdateTranscriptionAsync(string locale, string speechRecognitionModelEndpointId, CancellationToken cancellationToken = default)
1437+
public virtual async Task<Response> UpdateTranscriptionAsync(UpdateTranscriptionOptions options = default, CancellationToken cancellationToken = default)
14351438
{
14361439
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UpdateTranscription)}");
14371440
scope.Start();
14381441
try
14391442
{
1440-
UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(locale) { SpeechRecognitionModelEndpointId = speechRecognitionModelEndpointId };
1443+
UpdateTranscriptionRequestInternal request = new(options.Locale)
1444+
{
1445+
OperationContext = options.OperationContext,
1446+
SpeechRecognitionModelEndpointId = options.SpeechRecognitionModelEndpointId
1447+
};
1448+
14411449
return await CallMediaRestClient.UpdateTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false);
14421450
}
14431451
catch (Exception ex)
@@ -1536,7 +1544,7 @@ public virtual async Task<Response> StopMediaStreamingAsync(StopMediaStreamingOp
15361544
{
15371545
var request = options == default
15381546
? new StopMediaStreamingRequestInternal()
1539-
: new StopMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri };
1547+
: new StopMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, OperationContext = options.OperationContext };
15401548

15411549
return await CallMediaRestClient.StopMediaStreamingAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false);
15421550
}

sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.Serialization.cs

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.cs

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.Serialization.cs

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.cs

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.CallAutomation/src/Models/StopMediaStreamingOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ public class StopMediaStreamingOptions
1515
/// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used.
1616
/// </summary>
1717
public Uri OperationCallbackUri { get; set; }
18+
19+
/// <summary> The value to identify context of the operation. </summary>
20+
public string OperationContext { get; set; }
1821
}
1922
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
namespace Azure.Communication.CallAutomation
5+
{
6+
/// <summary>
7+
/// Options for the stop transcription Request.
8+
/// </summary>
9+
public class UpdateTranscriptionOptions
10+
{
11+
/// <summary>
12+
/// Options for the Update Transcription operation.
13+
/// </summary>
14+
public UpdateTranscriptionOptions(string locale)
15+
{
16+
this.Locale = locale;
17+
}
18+
19+
/// <summary> Defines Locale for the transcription e,g en-US. </summary>
20+
internal string Locale { get; set; }
21+
22+
/// <summary> The value to identify context of the operation. </summary>
23+
public string OperationContext { get; set; }
24+
25+
/// <summary> Endpoint where the custom model was deployed. </summary>
26+
public string SpeechRecognitionModelEndpointId { get; set; }
27+
}
28+
}

sdk/communication/Azure.Communication.CallAutomation/src/autorest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ model-namespace: false
1010
tag: package-2024-06-15-preview
1111

1212
require:
13-
- https://github.com/Azure/azure-rest-api-specs/blob/d1296700aa6cd650970e9891dd58eef5698327fd/specification/communication/data-plane/CallAutomation/readme.md
13+
- https://github.com/Azure/azure-rest-api-specs/blob/1aa912658531534e4e57ea613591075f7b97897c/specification/communication/data-plane/CallAutomation/readme.md
1414

1515

1616
title: Azure Communication Services

0 commit comments

Comments
 (0)