From 71c952825618aac76634aa7cf7c48454cca56e1f Mon Sep 17 00:00:00 2001 From: Naveed Ali Date: Tue, 15 Jun 2021 02:40:07 -0700 Subject: [PATCH 1/3] Added AddParticipantResult, Re-added communication error, updated swagger path --- .../src/CallConnection.cs | 4 +- .../Generated/CallConnectionsRestClient.cs | 33 ++++++--- .../Generated/CallingServerModelFactory.cs | 31 +++++++++ .../AddParticipantResult.Serialization.cs | 29 ++++++++ .../Generated/Models/AddParticipantResult.cs | 28 ++++++++ .../CallingServerError.Serialization.cs | 69 +++++++++++++++++++ ...nicationError.cs => CallingServerError.cs} | 27 ++++++-- ...allingServerErrorResponse.Serialization.cs | 29 ++++++++ .../Models/CallingServerErrorResponse.cs | 31 +++++++++ .../src/Generated/ServerCallsRestClient.cs | 43 ++++++++---- .../src/Models/CallingServerError.cs | 12 ++++ .../src/Models/CallingServerErrorResponse.cs | 12 ++++ .../src/ServerCall.cs | 4 +- .../src/autorest.md | 2 +- .../CallConnectionTests.cs | 4 +- .../CallingServerClients/ServerCallTests.cs | 4 +- 16 files changed, 323 insertions(+), 39 deletions(-) create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.cs create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs rename sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/{CommunicationError.cs => CallingServerError.cs} (53%) create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs create mode 100644 sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs diff --git a/sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs b/sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs index e403c90871176..b51276df2bbc6 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs @@ -232,7 +232,7 @@ public virtual Response PlayAudio(PlayAudioOptions options, Can /// The cancellation token. /// The server returned an error. See for details returned from the server. /// is null. - public virtual async Task AddParticipantAsync(CommunicationIdentifier participant, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) + public virtual async Task> AddParticipantAsync(CommunicationIdentifier participant, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(AddParticipant)}"); scope.Start(); @@ -263,7 +263,7 @@ public virtual async Task AddParticipantAsync(CommunicationIdentifier /// The cancellation token. /// The server returned an error. See for details returned from the server. /// is null. - public virtual Response AddParticipant(CommunicationIdentifier participant, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) + public virtual Response AddParticipant(CommunicationIdentifier participant, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(AddParticipant)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallConnectionsRestClient.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallConnectionsRestClient.cs index fb97581fb2ca4..122f97dd712c8 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallConnectionsRestClient.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallConnectionsRestClient.cs @@ -180,10 +180,11 @@ internal HttpMessage CreateHangupCallRequest(string callConnectionId) uri.AppendPath("/:hangup", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } - /// Hangup a call. + /// Hangup the call. /// The call connection id. /// The cancellation token to use. /// is null. @@ -205,7 +206,7 @@ public async Task HangupCallAsync(string callConnectionId, Cancellatio } } - /// Hangup a call. + /// Hangup the call. /// The call connection id. /// The cancellation token to use. /// is null. @@ -255,7 +256,7 @@ internal HttpMessage CreatePlayAudioRequest(string callConnectionId, string audi return message; } - /// Play audio in a call. + /// Play audio in the call. /// The call connection id. /// /// The media resource uri of the play audio request. @@ -295,7 +296,7 @@ public async Task> PlayAudioAsync(string callConnectio } } - /// Play audio in a call. + /// Play audio in the call. /// The call connection id. /// /// The media resource uri of the play audio request. @@ -427,6 +428,7 @@ internal HttpMessage CreateAddParticipantRequest(string callConnectionId, PhoneN uri.AppendPath("/participants", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var model = new AddParticipantRequest() { @@ -449,7 +451,7 @@ internal HttpMessage CreateAddParticipantRequest(string callConnectionId, PhoneN /// The callback URI. /// The cancellation token to use. /// is null. - public async Task AddParticipantAsync(string callConnectionId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) + public async Task> AddParticipantAsync(string callConnectionId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) { if (callConnectionId == null) { @@ -461,7 +463,12 @@ public async Task AddParticipantAsync(string callConnectionId, PhoneNu switch (message.Response.Status) { case 202: - return message.Response; + { + AddParticipantResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddParticipantResult.DeserializeAddParticipantResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } @@ -475,7 +482,7 @@ public async Task AddParticipantAsync(string callConnectionId, PhoneNu /// The callback URI. /// The cancellation token to use. /// is null. - public Response AddParticipant(string callConnectionId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) + public Response AddParticipant(string callConnectionId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) { if (callConnectionId == null) { @@ -487,7 +494,12 @@ public Response AddParticipant(string callConnectionId, PhoneNumberIdentifierMod switch (message.Response.Status) { case 202: - return message.Response; + { + AddParticipantResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddParticipantResult.DeserializeAddParticipantResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } @@ -506,10 +518,11 @@ internal HttpMessage CreateRemoveParticipantRequest(string callConnectionId, str uri.AppendPath(participantId, true); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } - /// Remove participant from the call. + /// Remove a participant from the call. /// The call connection id. /// The participant id. /// The cancellation token to use. @@ -536,7 +549,7 @@ public async Task RemoveParticipantAsync(string callConnectionId, stri } } - /// Remove participant from the call. + /// Remove a participant from the call. /// The call connection id. /// The participant id. /// The cancellation token to use. diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs index 809afdd0c484e..3cdddd765777e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs @@ -5,6 +5,8 @@ #nullable disable +using System.Collections.Generic; + namespace Azure.Communication.CallingServer { /// Model factory for read-only models. @@ -18,6 +20,27 @@ public static CreateCallResult CreateCallResult(string callConnectionId = defaul return new CreateCallResult(callConnectionId); } + /// Initializes new instance of CallingServerErrorResponse class. + /// The Communication Services error. + /// A new instance for mocking. + public static CallingServerErrorResponse CallingServerErrorResponse(CallingServerError error = default) + { + return new CallingServerErrorResponse(error); + } + + /// Initializes new instance of CallingServerError class. + /// The error code. + /// The error message. + /// The error target. + /// Further details about specific errors that led to this error. + /// The inner error if any. + /// A new instance for mocking. + public static CallingServerError CallingServerError(string code = default, string message = default, string target = default, IReadOnlyList details = default, CallingServerError innerError = default) + { + details ??= new List(); + return new CallingServerError(code, message, target, details, innerError); + } + /// Initializes new instance of PlayAudioResult class. /// The operation id. /// The status of the operation. @@ -62,6 +85,14 @@ public static CancelAllMediaOperationsResult CancelAllMediaOperationsResult(stri return new CancelAllMediaOperationsResult(operationId, status, operationContext, resultInfo); } + /// Initializes new instance of AddParticipantResult class. + /// The id of the added participant. + /// A new instance for mocking. + public static AddParticipantResult AddParticipantResult(string participantId = default) + { + return new AddParticipantResult(participantId); + } + /// Initializes new instance of StartCallRecordingResult class. /// The recording id of the started recording. /// A new instance for mocking. diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.Serialization.cs new file mode 100644 index 0000000000000..1ad1575d62241 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallingServer +{ + public partial class AddParticipantResult + { + internal static AddParticipantResult DeserializeAddParticipantResult(JsonElement element) + { + Optional participantId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("participantId")) + { + participantId = property.Value.GetString(); + continue; + } + } + return new AddParticipantResult(participantId.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.cs new file mode 100644 index 0000000000000..827e351accce7 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResult.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallingServer +{ + /// The add participant result. + public partial class AddParticipantResult + { + /// Initializes a new instance of AddParticipantResult. + internal AddParticipantResult() + { + } + + /// Initializes a new instance of AddParticipantResult. + /// The id of the added participant. + internal AddParticipantResult(string participantId) + { + ParticipantId = participantId; + } + + /// The id of the added participant. + public string ParticipantId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs new file mode 100644 index 0000000000000..f8ec6aff366a0 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallingServer +{ + public partial class CallingServerError + { + internal static CallingServerError DeserializeCallingServerError(JsonElement element) + { + string code = default; + string message = default; + Optional target = default; + Optional> details = default; + Optional innererror = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target")) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeCallingServerError(item)); + } + details = array; + continue; + } + if (property.NameEquals("innererror")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + innererror = DeserializeCallingServerError(property.Value); + continue; + } + } + return new CallingServerError(code, message, target.Value, Optional.ToList(details), innererror.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs similarity index 53% rename from sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs rename to sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs index 5f734d2279d0a..be322746cd54e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs @@ -12,13 +12,13 @@ namespace Azure.Communication.CallingServer { /// The Communication Services error. - internal partial class CommunicationError + public partial class CallingServerError { - /// Initializes a new instance of CommunicationError. + /// Initializes a new instance of CallingServerError. /// The error code. /// The error message. /// or is null. - internal CommunicationError(string code, string message) + internal CallingServerError(string code, string message) { if (code == null) { @@ -31,7 +31,22 @@ internal CommunicationError(string code, string message) Code = code; Message = message; - Details = new ChangeTrackingList(); + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of CallingServerError. + /// The error code. + /// The error message. + /// The error target. + /// Further details about specific errors that led to this error. + /// The inner error if any. + internal CallingServerError(string code, string message, string target, IReadOnlyList details, CallingServerError innerError) + { + Code = code; + Message = message; + Target = target; + Details = details; + InnerError = innerError; } /// The error code. @@ -41,8 +56,8 @@ internal CommunicationError(string code, string message) /// The error target. public string Target { get; } /// Further details about specific errors that led to this error. - public IReadOnlyList Details { get; } + public IReadOnlyList Details { get; } /// The inner error if any. - public CommunicationError InnerError { get; } + public CallingServerError InnerError { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs new file mode 100644 index 0000000000000..781767ece00a3 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallingServer +{ + public partial class CallingServerErrorResponse + { + internal static CallingServerErrorResponse DeserializeCallingServerErrorResponse(JsonElement element) + { + CallingServerError error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error")) + { + error = CallingServerError.DeserializeCallingServerError(property.Value); + continue; + } + } + return new CallingServerErrorResponse(error); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs new file mode 100644 index 0000000000000..9ead27feb091c --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Communication.CallingServer +{ + /// The Communication Services error. + public partial class CallingServerErrorResponse + { + /// Initializes a new instance of CallingServerErrorResponse. + /// The Communication Services error. + /// is null. + internal CallingServerErrorResponse(CallingServerError error) + { + if (error == null) + { + throw new ArgumentNullException(nameof(error)); + } + + Error = error; + } + + /// The Communication Services error. + public CallingServerError Error { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/ServerCallsRestClient.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/ServerCallsRestClient.cs index e8fae88b8acd5..a5d581374cdc2 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/ServerCallsRestClient.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/ServerCallsRestClient.cs @@ -59,6 +59,7 @@ internal HttpMessage CreateAddParticipantRequest(string serverCallId, PhoneNumbe uri.AppendPath("/participants", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var model = new AddParticipantRequest() { @@ -81,7 +82,7 @@ internal HttpMessage CreateAddParticipantRequest(string serverCallId, PhoneNumbe /// The callback URI. /// The cancellation token to use. /// is null. - public async Task AddParticipantAsync(string serverCallId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) + public async Task> AddParticipantAsync(string serverCallId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) { if (serverCallId == null) { @@ -93,7 +94,12 @@ public async Task AddParticipantAsync(string serverCallId, PhoneNumber switch (message.Response.Status) { case 202: - return message.Response; + { + AddParticipantResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddParticipantResult.DeserializeAddParticipantResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } @@ -107,7 +113,7 @@ public async Task AddParticipantAsync(string serverCallId, PhoneNumber /// The callback URI. /// The cancellation token to use. /// is null. - public Response AddParticipant(string serverCallId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) + public Response AddParticipant(string serverCallId, PhoneNumberIdentifierModel alternateCallerId = null, CommunicationIdentifierModel participant = null, string operationContext = null, string callbackUri = null, CancellationToken cancellationToken = default) { if (serverCallId == null) { @@ -119,7 +125,12 @@ public Response AddParticipant(string serverCallId, PhoneNumberIdentifierModel a switch (message.Response.Status) { case 202: - return message.Response; + { + AddParticipantResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddParticipantResult.DeserializeAddParticipantResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } @@ -138,6 +149,7 @@ internal HttpMessage CreateRemoveParticipantRequest(string serverCallId, string uri.AppendPath(participantId, true); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } @@ -219,7 +231,7 @@ internal HttpMessage CreateStartRecordingRequest(string serverCallId, string rec return message; } - /// Start call recording request. + /// Start recording of the call. /// The server call id. /// The uri to send notifications to. /// The cancellation token to use. @@ -247,7 +259,7 @@ public async Task> StartRecordingAsync(string } } - /// Start call recording request. + /// Start recording of the call. /// The server call id. /// The uri to send notifications to. /// The cancellation token to use. @@ -369,10 +381,11 @@ internal HttpMessage CreateStopRecordingRequest(string serverCallId, string reco uri.AppendPath(recordingId, true); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } - /// Stop recording a call. + /// Stop recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -399,7 +412,7 @@ public async Task StopRecordingAsync(string serverCallId, string recor } } - /// Stop recording a call. + /// Stop recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -440,10 +453,11 @@ internal HttpMessage CreatePauseRecordingRequest(string serverCallId, string rec uri.AppendPath("/:pause", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } - /// Pause recording a call. + /// Pause recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -470,7 +484,7 @@ public async Task PauseRecordingAsync(string serverCallId, string reco } } - /// Pause recording a call. + /// Pause recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -511,10 +525,11 @@ internal HttpMessage CreateResumeRecordingRequest(string serverCallId, string re uri.AppendPath("/:resume", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); return message; } - /// Resume recording a call. + /// Resume recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -541,7 +556,7 @@ public async Task ResumeRecordingAsync(string serverCallId, string rec } } - /// Resume recording a call. + /// Resume recording the call. /// The server call id. /// The recording id. /// The cancellation token to use. @@ -715,7 +730,7 @@ internal HttpMessage CreatePlayAudioRequest(string serverCallId, string audioFil return message; } - /// Play audio in a call. + /// Play audio in the call. /// The server call id. /// /// The media resource uri of the play audio request. @@ -755,7 +770,7 @@ public async Task> PlayAudioAsync(string serverCallId, } } - /// Play audio in a call. + /// Play audio in the call. /// The server call id. /// /// The media resource uri of the play audio request. diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs new file mode 100644 index 0000000000000..24b8597fd5be8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallingServer +{ + [CodeGenModel("CommunicationError")] + public partial class CallingServerError + { + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs new file mode 100644 index 0000000000000..8ef473a70d79d --- /dev/null +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallingServer +{ + [CodeGenModel("CommunicationErrorResponse")] + public partial class CallingServerErrorResponse + { + } +} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/ServerCall.cs b/sdk/communication/Azure.Communication.CallingServer/src/ServerCall.cs index 71b38e2dab116..204d2015f9600 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/ServerCall.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/ServerCall.cs @@ -108,7 +108,7 @@ public virtual Response PlayAudio(Uri audioFileUri, string audi /// The phone number to use when adding a pstn participant. /// The operation context. /// The cancellation token. - public virtual Response AddParticipant(CommunicationIdentifier participant, Uri callbackUri, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) + public virtual Response AddParticipant(CommunicationIdentifier participant, Uri callbackUri, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ServerCall)}.{nameof(AddParticipant)}"); scope.Start(); @@ -140,7 +140,7 @@ public virtual Response AddParticipant(CommunicationIdentifier participant, Uri /// The phone number to use when adding a pstn participant. /// The operation context. /// The cancellation token. - public virtual async Task AddParticipantAsync(CommunicationIdentifier participant, Uri callbackUri, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) + public virtual async Task> AddParticipantAsync(CommunicationIdentifier participant, Uri callbackUri, string alternateCallerId = default, string operationContext = default, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ServerCall)}.{nameof(AddParticipant)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.CallingServer/src/autorest.md b/sdk/communication/Azure.Communication.CallingServer/src/autorest.md index 98172ceb840de..6c6ca21a58bb0 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallingServer/src/autorest.md @@ -16,7 +16,7 @@ The following are the settings for generating this API with AutoRest. ```yaml tag: beta -input-file: https://github.com/Azure/azure-rest-api-specs/blob/b9f6b6af5dcf08d665541636e41e7546a0237acd/specification/communication/data-plane/CallingServer/preview/2021-06-15-preview/communicationservicescallingserver.json +input-file: https://github.com/Azure/azure-rest-api-specs/blob/60ae3d6b8806c896f2e54e4bfd900357dbcfd54a/specification/communication/data-plane/CallingServer/preview/2021-06-15-preview/communicationservicescallingserver.json payload-flattening-threshold: 10 clear-output-folder: true directive: diff --git a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs index 774d7effc163b..5697b754a9b69 100644 --- a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs +++ b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs @@ -166,7 +166,7 @@ public async Task AddParticipantsAsync_Passes(CommunicationIdentifier participan var response = await callConnection.AddParticipantAsync(participant, alternateCallerId, operationContext).ConfigureAwait(false); - Assert.AreEqual((int)HttpStatusCode.Accepted, response.Status); + Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); } [TestCaseSource(nameof(TestData_AddParticipant))] @@ -176,7 +176,7 @@ public void AddParticipants_Passes(CommunicationIdentifier participant, string a var response = callConnection.AddParticipant(participant, alternateCallerId, operationContext); - Assert.AreEqual((int)HttpStatusCode.Accepted, response.Status); + Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); } [TestCaseSource(nameof(TestData_ParticipantId))] diff --git a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs index 43463d2c1f4ac..8169871526673 100644 --- a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs +++ b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs @@ -132,7 +132,7 @@ public async Task AddParticipantsAsync_Return202Accepted(CommunicationIdentifier var response = await serverCall.AddParticipantAsync(participant, callBack, alternateCallerId, operationContext).ConfigureAwait(false); - Assert.AreEqual((int)HttpStatusCode.Accepted, response.Status); + Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); } [TestCaseSource(nameof(TestData_AddParticipant))] @@ -142,7 +142,7 @@ public void AddParticipants_Return202Accepted(CommunicationIdentifier participan var response = serverCall.AddParticipant(participant, callBack, alternateCallerId, operationContext); - Assert.AreEqual((int)HttpStatusCode.Accepted, response.Status); + Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); } [TestCaseSource(nameof(TestData_ParticipantId))] From aec768be6f1784f3e575c455f033a9b7baf16bb4 Mon Sep 17 00:00:00 2001 From: Naveed Ali Date: Tue, 15 Jun 2021 12:46:39 -0700 Subject: [PATCH 2/3] Fixed unit tests --- .../CallConnectionTests.cs | 40 +++++-------------- .../CallingServerClients/ServerCallTests.cs | 12 ++++-- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs index 5697b754a9b69..17a56ca5ebd86 100644 --- a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs +++ b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/CallConnectionTests.cs @@ -12,7 +12,7 @@ namespace Azure.Communication.CallingServer.Tests public class CallConnectionTests : CallingServerTestBase { private const string CancelAllMediaOperaionsResponsePayload = "{" + - "\"id\": \"dummyId\"," + + "\"operationId\": \"dummyId\"," + "\"status\": \"completed\"," + "\"operationContext\": \"dummyOperationContext\"," + "\"resultInfo\": {" + @@ -23,7 +23,7 @@ public class CallConnectionTests : CallingServerTestBase "}"; private const string PlayAudioResponsePayload = "{" + - "\"id\": \"dummyId\"," + + "\"operationId\": \"dummyId\"," + "\"status\": \"running\"," + "\"operationContext\": \"dummyOperationContext\"," + "\"resultInfo\": {" + @@ -33,33 +33,9 @@ public class CallConnectionTests : CallingServerTestBase "}" + "}"; - private const string GetCallConnectionDetailsPayload = "{" + - "\"callConnectionId\": \"411f6d00-1d3f-425b-9d7d-df971f16564b\", " + - "\"source\":{ \"rawId\": \"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d376\", \"communicationUser\": {\"id\":\"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d376\"}}," + - "\"targets\":[{ \"rawId\": \"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000009-9189-b73c-edbe-a43a0d0050e3\", \"communicationUser\": {\"id\":\"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000009-9189-b73c-edbe-a43a0d0050e3\"}}]," + - "\"callState\":\"establishing\"," + - "\"subject\":\"testsubject\"," + - "\"callbackUri\":\"https://bot.contoso.io/callback\"," + - "\"requestedMediaTypes\":[\"audio\", \"video\"]," + - "\"requestedCallEvents\":[\"dtmfReceived\"]" + - "}"; - - private const string GetParticipantsPayload = "[" + - "{ \"identifier\": {\"rawId\": \"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d371\", \"communicationUser\": {\"id\":\"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d371\"}}, \"participantId\": \"ef70f6b0-c052-4ab7-9fdc-2dedb5fd16ac\", \"isMuted\": true }, " + - "{ \"identifier\": {\"rawId\": \"4:+14251234567\", \"phoneNumber\": {\"value\":\"+14251234567\"}}, \"participantId\": \"e44ca273-079f-4759-8d6e-284ee8322625\", \"isMuted\": false }" + - "]"; - - private const string GetParticipantPayload1 = "{ " + - "\"identifier\": {\"rawId\": \"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d371\", \"communicationUser\": {\"id\":\"8:acs:024a7064-0581-40b9-be73-6dde64d69d89_00000008-ddad-a008-b8ba-a43a0d00d371\"}}, " + - "\"participantId\": \"ef70f6b0-c052-4ab7-9fdc-2dedb5fd16ac\", " + - "\"isMuted\": true " + - "}"; - - private const string GetParticipantPayload2 = "{ " + - "\"identifier\": {\"rawId\": \"4:+14251234567\", \"phoneNumber\": {\"value\":\"+14251234567\"}}, " + - "\"participantId\": \"e44ca273-079f-4759-8d6e-284ee8322625\", " + - "\"isMuted\": false " + - "}"; + private const string AddParticipantResultPayload = "{" + + "\"participantId\": \"dummyparticipantid\"" + + "}"; [TestCaseSource(nameof(TestData_CallConnectionId))] public async Task HangupCallAsync_Passes(string callConnectionId) @@ -162,21 +138,23 @@ public void PlayAudioOverload_Passes(Uri sampleAudioFileUri, string sampleAudioF [TestCaseSource(nameof(TestData_AddParticipant))] public async Task AddParticipantsAsync_Passes(CommunicationIdentifier participant, string alternateCallerId, string operationContext) { - var callConnection = CreateMockCallConnection(202); + var callConnection = CreateMockCallConnection(202, AddParticipantResultPayload); var response = await callConnection.AddParticipantAsync(participant, alternateCallerId, operationContext).ConfigureAwait(false); Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); + Assert.AreEqual("dummyparticipantid", response.Value.ParticipantId); } [TestCaseSource(nameof(TestData_AddParticipant))] public void AddParticipants_Passes(CommunicationIdentifier participant, string alternateCallerId, string operationContext) { - var callConnection = CreateMockCallConnection(202); + var callConnection = CreateMockCallConnection(202, AddParticipantResultPayload); var response = callConnection.AddParticipant(participant, alternateCallerId, operationContext); Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); + Assert.AreEqual("dummyparticipantid", response.Value.ParticipantId); } [TestCaseSource(nameof(TestData_ParticipantId))] diff --git a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs index 8169871526673..de53559b2ea5e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs +++ b/sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/ServerCallTests.cs @@ -19,7 +19,7 @@ public class ServerCallTests : CallingServerTestBase "}"; private const string DummyPlayAudioResponse = "{" + - "\"id\": \"dummyId\"," + + "\"operationId\": \"dummyId\"," + "\"status\": \"running\"," + "\"operationContext\": \"dummyOperationContext\"," + "\"resultInfo\": {" + @@ -29,6 +29,10 @@ public class ServerCallTests : CallingServerTestBase "}" + "}"; + private const string AddParticipantResultPayload = "{" + + "\"participantId\": \"dummyparticipantid\"" + + "}"; + [TestCaseSource(nameof(TestData_StartRecording))] public void StartRecording_Returns200Ok(Uri sampleCallBackUri) { @@ -128,21 +132,23 @@ public async Task PlayAudioAsync_Return202Accepted(Uri sampleAudioFileUri, strin [TestCaseSource(nameof(TestData_AddParticipant))] public async Task AddParticipantsAsync_Return202Accepted(CommunicationIdentifier participant, Uri callBack, string alternateCallerId, string operationContext) { - var serverCall = CreateMockServerCall(202); + var serverCall = CreateMockServerCall(202, AddParticipantResultPayload); var response = await serverCall.AddParticipantAsync(participant, callBack, alternateCallerId, operationContext).ConfigureAwait(false); Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); + Assert.AreEqual("dummyparticipantid", response.Value.ParticipantId); } [TestCaseSource(nameof(TestData_AddParticipant))] public void AddParticipants_Return202Accepted(CommunicationIdentifier participant, Uri callBack, string alternateCallerId, string operationContext) { - var serverCall = CreateMockServerCall(202); + var serverCall = CreateMockServerCall(202, AddParticipantResultPayload); var response = serverCall.AddParticipant(participant, callBack, alternateCallerId, operationContext); Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); + Assert.AreEqual("dummyparticipantid", response.Value.ParticipantId); } [TestCaseSource(nameof(TestData_ParticipantId))] From 30634486614a624dac16f6d4e093349d13b355b0 Mon Sep 17 00:00:00 2001 From: Naveed Ali Date: Tue, 15 Jun 2021 13:11:28 -0700 Subject: [PATCH 3/3] Updated netstandard --- ...munication.CallingServer.netstandard2.0.cs | 123 ++++++++++-------- 1 file changed, 72 insertions(+), 51 deletions(-) diff --git a/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs index a228b741b26ad..895db002e7a6a 100644 --- a/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs @@ -1,11 +1,24 @@ namespace Azure.Communication.CallingServer { + public partial class AddParticipantResult + { + internal AddParticipantResult() { } + public string ParticipantId { get { throw null; } } + } + public partial class AddParticipantResultEvent : Azure.Communication.CallingServer.CallingServerEventBase + { + public AddParticipantResultEvent() { } + public string OperationContext { get { throw null; } set { } } + public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } set { } } + public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } set { } } + public static Azure.Communication.CallingServer.AddParticipantResultEvent Deserialize(string content) { throw null; } + } public partial class CallConnection { protected CallConnection() { } public virtual string CallConnectionId { get { throw null; } } - public virtual Azure.Response AddParticipant(Azure.Communication.CommunicationIdentifier participant, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task AddParticipantAsync(Azure.Communication.CommunicationIdentifier participant, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipant(Azure.Communication.CommunicationIdentifier participant, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantAsync(Azure.Communication.CommunicationIdentifier participant, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CancelAllMediaOperations(string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CancelAllMediaOperationsAsync(string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Hangup(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -23,17 +36,11 @@ protected CallConnection() { } private readonly object _dummy; private readonly int _dummyPrimitive; public CallConnectionState(string value) { throw null; } - public static Azure.Communication.CallingServer.CallConnectionState Established { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Establishing { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Hold { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Idle { get { throw null; } } + public static Azure.Communication.CallingServer.CallConnectionState Connected { get { throw null; } } + public static Azure.Communication.CallingServer.CallConnectionState Connecting { get { throw null; } } + public static Azure.Communication.CallingServer.CallConnectionState Disconnected { get { throw null; } } + public static Azure.Communication.CallingServer.CallConnectionState Disconnecting { get { throw null; } } public static Azure.Communication.CallingServer.CallConnectionState Incoming { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Redirecting { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Terminated { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Terminating { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Transferring { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Unhold { get { throw null; } } - public static Azure.Communication.CallingServer.CallConnectionState Unknown { get { throw null; } } public bool Equals(Azure.Communication.CallingServer.CallConnectionState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -71,6 +78,20 @@ public enum ServiceVersion V2021_06_15_Preview = 0, } } + public partial class CallingServerError + { + internal CallingServerError() { } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.Communication.CallingServer.CallingServerError InnerError { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + } + public partial class CallingServerErrorResponse + { + internal CallingServerErrorResponse() { } + public Azure.Communication.CallingServer.CallingServerError Error { get { throw null; } } + } public abstract partial class CallingServerEventBase { protected CallingServerEventBase() { } @@ -96,23 +117,18 @@ protected CallingServerEventBase() { } public static bool operator !=(Azure.Communication.CallingServer.CallingServerEventType left, Azure.Communication.CallingServer.CallingServerEventType right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CallModality : System.IEquatable + public partial class CallParticipant { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CallModality(string value) { throw null; } - public static Azure.Communication.CallingServer.CallModality Audio { get { throw null; } } - public static Azure.Communication.CallingServer.CallModality Video { get { throw null; } } - public bool Equals(Azure.Communication.CallingServer.CallModality other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Communication.CallingServer.CallModality left, Azure.Communication.CallingServer.CallModality right) { throw null; } - public static implicit operator Azure.Communication.CallingServer.CallModality (string value) { throw null; } - public static bool operator !=(Azure.Communication.CallingServer.CallModality left, Azure.Communication.CallingServer.CallModality right) { throw null; } - public override string ToString() { throw null; } + public CallParticipant() { } + public CallParticipant(Azure.Communication.CommunicationIdentifier identifier, string participantId, bool? isMuted) { } + public Azure.Communication.CommunicationIdentifier Identifier { get { throw null; } set { } } + public bool? IsMuted { get { throw null; } set { } } + public string ParticipantId { get { throw null; } set { } } + } + public partial class CallRecordingProperties + { + internal CallRecordingProperties() { } + public Azure.Communication.CallingServer.CallRecordingState? RecordingState { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CallRecordingState : System.IEquatable @@ -141,16 +157,11 @@ public CallRecordingStateChangeEvent() { } public Azure.Communication.CallingServer.CallRecordingState? State { get { throw null; } set { } } public static Azure.Communication.CallingServer.CallRecordingStateChangeEvent Deserialize(string content) { throw null; } } - public partial class CallRecordingStateResult - { - internal CallRecordingStateResult() { } - public Azure.Communication.CallingServer.CallRecordingState? RecordingState { get { throw null; } } - } public partial class CancelAllMediaOperationsResult { internal CancelAllMediaOperationsResult() { } - public string Id { get { throw null; } } public string OperationContext { get { throw null; } } + public string OperationId { get { throw null; } } public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } } } @@ -181,11 +192,11 @@ public partial struct ContentTransferOptions : System.IEquatable requestedMediaTypes, System.Collections.Generic.IEnumerable requestedCallEvents) { } + public CreateCallOptions(System.Uri callbackUri, System.Collections.Generic.IEnumerable requestedMediaTypes, System.Collections.Generic.IEnumerable requestedCallEvents) { } public Azure.Communication.PhoneNumberIdentifier AlternateCallerId { get { throw null; } set { } } public System.Uri CallbackUri { get { throw null; } } public System.Collections.Generic.IList RequestedCallEvents { get { throw null; } } - public System.Collections.Generic.IList RequestedMediaTypes { get { throw null; } } + public System.Collections.Generic.IList RequestedMediaTypes { get { throw null; } } public string Subject { get { throw null; } set { } } } public partial class CreateCallResult @@ -220,20 +231,12 @@ public static partial class DownloadExtentions public static bool operator !=(Azure.Communication.CallingServer.EventSubscriptionType left, Azure.Communication.CallingServer.EventSubscriptionType right) { throw null; } public override string ToString() { throw null; } } - public partial class InviteParticipantsResultEvent : Azure.Communication.CallingServer.CallingServerEventBase - { - public InviteParticipantsResultEvent() { } - public string OperationContext { get { throw null; } set { } } - public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } set { } } - public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } set { } } - public static Azure.Communication.CallingServer.InviteParticipantsResultEvent Deserialize(string content) { throw null; } - } public partial class JoinCallOptions { - public JoinCallOptions(System.Uri callbackUri, System.Collections.Generic.IEnumerable requestedMediaTypes, System.Collections.Generic.IEnumerable requestedCallEvents) { } + public JoinCallOptions(System.Uri callbackUri, System.Collections.Generic.IEnumerable requestedMediaTypes, System.Collections.Generic.IEnumerable requestedCallEvents) { } public System.Uri CallbackUri { get { throw null; } } public System.Collections.Generic.IList RequestedCallEvents { get { throw null; } } - public System.Collections.Generic.IList RequestedMediaTypes { get { throw null; } } + public System.Collections.Generic.IList RequestedMediaTypes { get { throw null; } } public string Subject { get { throw null; } set { } } } public partial class JoinCallResult @@ -242,6 +245,24 @@ internal JoinCallResult() { } public string CallConnectionId { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MediaType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MediaType(string value) { throw null; } + public static Azure.Communication.CallingServer.MediaType Audio { get { throw null; } } + public static Azure.Communication.CallingServer.MediaType Video { get { throw null; } } + public bool Equals(Azure.Communication.CallingServer.MediaType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.CallingServer.MediaType left, Azure.Communication.CallingServer.MediaType right) { throw null; } + public static implicit operator Azure.Communication.CallingServer.MediaType (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallingServer.MediaType left, Azure.Communication.CallingServer.MediaType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OperationStatus : System.IEquatable { private readonly object _dummy; @@ -280,8 +301,8 @@ public PlayAudioOptions() { } public partial class PlayAudioResult { internal PlayAudioResult() { } - public string Id { get { throw null; } } public string OperationContext { get { throw null; } } + public string OperationId { get { throw null; } } public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } } } @@ -303,10 +324,10 @@ internal ResultInfo() { } public partial class ServerCall { protected ServerCall() { } - public virtual Azure.Response AddParticipant(Azure.Communication.CommunicationIdentifier participant, System.Uri callbackUri, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task AddParticipantAsync(Azure.Communication.CommunicationIdentifier participant, System.Uri callbackUri, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetRecordingState(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetRecordingStateAsync(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipant(Azure.Communication.CommunicationIdentifier participant, System.Uri callbackUri, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantAsync(Azure.Communication.CommunicationIdentifier participant, System.Uri callbackUri, string alternateCallerId = null, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRecordingState(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecordingStateAsync(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PauseRecording(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task PauseRecordingAsync(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PlayAudio(System.Uri audioFileUri, string audioFileId, System.Uri callbackUri, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }