Skip to content

Commit 841b308

Browse files
authored
Add MoveParticipants API and Event Handling Support (Azure#50197)
* Adding the Move Participants to Call Connection * Updated the Move Participants, removed the Live test as it cannot be tested for non p2p scenarios * Addressing PR comments: By adding the FromCall in MoveParticipantsEventResult
1 parent 02eaaa5 commit 841b308

24 files changed

+991
-48
lines changed

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ protected CallConnection() { }
301301
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.CallParticipant>>> GetParticipantsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
302302
public virtual Azure.Response HangUp(bool forEveryone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
303303
public virtual System.Threading.Tasks.Task<Azure.Response> HangUpAsync(bool forEveryone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
304+
public virtual Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult> MoveParticipants(Azure.Communication.CallAutomation.MoveParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
305+
public virtual Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult> MoveParticipants(string fromCall, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
306+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult>> MoveParticipantsAsync(Azure.Communication.CallAutomation.MoveParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
307+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult>> MoveParticipantsAsync(string fromCall, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
304308
public virtual Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult> MuteParticipant(Azure.Communication.CallAutomation.MuteParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
305309
public virtual Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult> MuteParticipant(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
306310
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult>> MuteParticipantAsync(Azure.Communication.CallAutomation.MuteParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
@@ -1306,6 +1310,46 @@ internal MediaStreamingUpdate() { }
13061310
public Azure.Communication.CallAutomation.MediaStreamingStatus? MediaStreamingStatus { get { throw null; } }
13071311
public Azure.Communication.CallAutomation.MediaStreamingStatusDetails? MediaStreamingStatusDetails { get { throw null; } }
13081312
}
1313+
public partial class MoveParticipantEventResult
1314+
{
1315+
internal MoveParticipantEventResult() { }
1316+
public Azure.Communication.CallAutomation.MoveParticipantFailed FailureResult { get { throw null; } }
1317+
public string FromCall { get { throw null; } }
1318+
public bool IsSuccess { get { throw null; } }
1319+
public Azure.Communication.CallAutomation.MoveParticipantSucceeded SuccessResult { get { throw null; } }
1320+
public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } }
1321+
}
1322+
public partial class MoveParticipantFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
1323+
{
1324+
internal MoveParticipantFailed() { }
1325+
public string FromCall { get { throw null; } }
1326+
public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } }
1327+
public static Azure.Communication.CallAutomation.MoveParticipantFailed Deserialize(string content) { throw null; }
1328+
}
1329+
public partial class MoveParticipantsOptions
1330+
{
1331+
public MoveParticipantsOptions(System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, string fromCall) { }
1332+
public string FromCall { get { throw null; } }
1333+
public System.Uri OperationCallbackUri { get { throw null; } set { } }
1334+
public string OperationContext { get { throw null; } set { } }
1335+
public System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> TargetParticipants { get { throw null; } }
1336+
}
1337+
public partial class MoveParticipantsResult
1338+
{
1339+
internal MoveParticipantsResult() { }
1340+
public string FromCall { get { throw null; } }
1341+
public string OperationContext { get { throw null; } }
1342+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.CallParticipant> TargetParticipants { get { throw null; } }
1343+
public Azure.Communication.CallAutomation.MoveParticipantEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1344+
public System.Threading.Tasks.Task<Azure.Communication.CallAutomation.MoveParticipantEventResult> WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1345+
}
1346+
public partial class MoveParticipantSucceeded : Azure.Communication.CallAutomation.CallAutomationEventBase
1347+
{
1348+
internal MoveParticipantSucceeded() { }
1349+
public string FromCall { get { throw null; } }
1350+
public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } }
1351+
public static Azure.Communication.CallAutomation.MoveParticipantSucceeded Deserialize(string content) { throw null; }
1352+
}
13091353
public partial class MuteParticipantOptions
13101354
{
13111355
public MuteParticipantOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { }

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ protected CallConnection() { }
301301
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.CallParticipant>>> GetParticipantsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
302302
public virtual Azure.Response HangUp(bool forEveryone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
303303
public virtual System.Threading.Tasks.Task<Azure.Response> HangUpAsync(bool forEveryone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
304+
public virtual Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult> MoveParticipants(Azure.Communication.CallAutomation.MoveParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
305+
public virtual Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult> MoveParticipants(string fromCall, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
306+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult>> MoveParticipantsAsync(Azure.Communication.CallAutomation.MoveParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
307+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MoveParticipantsResult>> MoveParticipantsAsync(string fromCall, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
304308
public virtual Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult> MuteParticipant(Azure.Communication.CallAutomation.MuteParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
305309
public virtual Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult> MuteParticipant(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
306310
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.MuteParticipantResult>> MuteParticipantAsync(Azure.Communication.CallAutomation.MuteParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
@@ -1305,6 +1309,46 @@ internal MediaStreamingUpdate() { }
13051309
public Azure.Communication.CallAutomation.MediaStreamingStatus? MediaStreamingStatus { get { throw null; } }
13061310
public Azure.Communication.CallAutomation.MediaStreamingStatusDetails? MediaStreamingStatusDetails { get { throw null; } }
13071311
}
1312+
public partial class MoveParticipantEventResult
1313+
{
1314+
internal MoveParticipantEventResult() { }
1315+
public Azure.Communication.CallAutomation.MoveParticipantFailed FailureResult { get { throw null; } }
1316+
public string FromCall { get { throw null; } }
1317+
public bool IsSuccess { get { throw null; } }
1318+
public Azure.Communication.CallAutomation.MoveParticipantSucceeded SuccessResult { get { throw null; } }
1319+
public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } }
1320+
}
1321+
public partial class MoveParticipantFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
1322+
{
1323+
internal MoveParticipantFailed() { }
1324+
public string FromCall { get { throw null; } }
1325+
public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } }
1326+
public static Azure.Communication.CallAutomation.MoveParticipantFailed Deserialize(string content) { throw null; }
1327+
}
1328+
public partial class MoveParticipantsOptions
1329+
{
1330+
public MoveParticipantsOptions(System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targetParticipants, string fromCall) { }
1331+
public string FromCall { get { throw null; } }
1332+
public System.Uri OperationCallbackUri { get { throw null; } set { } }
1333+
public string OperationContext { get { throw null; } set { } }
1334+
public System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> TargetParticipants { get { throw null; } }
1335+
}
1336+
public partial class MoveParticipantsResult
1337+
{
1338+
internal MoveParticipantsResult() { }
1339+
public string FromCall { get { throw null; } }
1340+
public string OperationContext { get { throw null; } }
1341+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.CallAutomation.CallParticipant> TargetParticipants { get { throw null; } }
1342+
public Azure.Communication.CallAutomation.MoveParticipantEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1343+
public System.Threading.Tasks.Task<Azure.Communication.CallAutomation.MoveParticipantEventResult> WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1344+
}
1345+
public partial class MoveParticipantSucceeded : Azure.Communication.CallAutomation.CallAutomationEventBase
1346+
{
1347+
internal MoveParticipantSucceeded() { }
1348+
public string FromCall { get { throw null; } }
1349+
public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } }
1350+
public static Azure.Communication.CallAutomation.MoveParticipantSucceeded Deserialize(string content) { throw null; }
1351+
}
13081352
public partial class MuteParticipantOptions
13091353
{
13101354
public MuteParticipantOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
7+
namespace Azure.Communication.CallAutomation
8+
{
9+
/// <summary><see cref="MoveParticipantEventResult"/> is returned from WaitForEvent of <see cref="MoveParticipantsResult"/>.</summary>
10+
public class MoveParticipantEventResult
11+
{
12+
/// <summary>
13+
/// Indicates whether the returned event is considered successful or not.
14+
/// </summary>
15+
public bool IsSuccess { get; internal set; }
16+
17+
/// <summary>
18+
/// <see cref="MoveParticipantSucceeded"/> event will be returned when all participants were moved to the call successfully.
19+
/// </summary>
20+
public MoveParticipantSucceeded SuccessResult { get; }
21+
22+
/// <summary>
23+
/// <see cref="MoveParticipantFailed"/> event will be returned when participants could not be moved to the call.
24+
/// </summary>
25+
public MoveParticipantFailed FailureResult { get; }
26+
27+
/// <summary>
28+
/// <see cref="IReadOnlyList{CommunicationIdentifier}"/> Participants that were affected by the move operation.
29+
/// </summary>
30+
public CommunicationIdentifier TargetParticipant { get; }
31+
32+
/// <summary>
33+
/// The call connection ID from which the participant was moved.
34+
/// </summary>
35+
public string FromCall { get; }
36+
37+
internal MoveParticipantEventResult(bool isSuccess, MoveParticipantSucceeded successResult, MoveParticipantFailed failureResult, CommunicationIdentifier targetParticipant, string fromCall)
38+
{
39+
IsSuccess = isSuccess;
40+
SuccessResult = successResult;
41+
FailureResult = failureResult;
42+
TargetParticipant = targetParticipant;
43+
FromCall = fromCall;
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)