From a69b42e9a82f58b31fb0a711c59830674792eb4a Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Wed, 20 Sep 2023 10:26:37 -0700 Subject: [PATCH 01/10] Adding hold/unhold --- .../src/CallMedia.cs | 52 + .../src/Generated/CallConnectionRestClient.cs | 104 +- .../src/Generated/CallMediaRestClient.cs | 148 + ...CommunicationCallAutomationModelFactory.cs | 34 +- .../Models/AddParticipantCancelled.cs | 33 + ...articipantRequestInternal.Serialization.cs | 5 + .../Models/AddParticipantRequestInternal.cs | 2 + ...rticipantResponseInternal.Serialization.cs | 8 +- .../Models/AddParticipantResponseInternal.cs | 6 +- ...AnswerCallRequestInternal.Serialization.cs | 5 + .../Models/AnswerCallRequestInternal.cs | 2 + ...nectionPropertiesInternal.Serialization.cs | 8 +- .../CallConnectionPropertiesInternal.cs | 6 +- .../CallTransferAccepted.Serialization.cs | 23 +- .../Generated/Models/CallTransferAccepted.cs | 8 +- .../Models/CancelAddParticipantFailed.cs | 31 + ...ncelAddParticipantRequest.Serialization.cs | 33 + .../Models/CancelAddParticipantRequest.cs | 33 + ...celAddParticipantResponse.Serialization.cs | 39 + .../Models/CancelAddParticipantResponse.cs | 32 + ...ecognitionRequestInternal.Serialization.cs | 5 + ...ontinuousDtmfRecognitionRequestInternal.cs | 2 + ...CreateCallRequestInternal.Serialization.cs | 5 + .../Models/CreateCallRequestInternal.cs | 2 + ...SensitivityUpdateInternal.Serialization.cs | 8 +- .../Models/DialogSensitivityUpdateInternal.cs | 10 +- ...articipantRequestInternal.Serialization.cs | 35 + .../Models/HoldParticipantRequestInternal.cs | 39 + .../PlayRequestInternal.Serialization.cs | 5 + .../Generated/Models/PlayRequestInternal.cs | 2 + .../RecognizeRequestInternal.Serialization.cs | 5 + .../Models/RecognizeRequestInternal.cs | 2 + .../RecordingStateResult.Serialization.cs | 12 +- .../Generated/Models/RecordingStateResult.cs | 6 +- .../src/Generated/Models/RecordingType.cs | 51 + ...articipantRequestInternal.Serialization.cs | 5 + .../RemoveParticipantRequestInternal.cs | 2 + .../SendDtmfRequestInternal.Serialization.cs | 5 + .../Models/SendDtmfRequestInternal.cs | 2 + .../Models/SensitiveFlag.Serialization.cs | 37 - .../src/Generated/Models/SensitiveFlag.cs | 28 - ...ranscriptionConfiguration.Serialization.cs | 29 + .../Models/TranscriptionConfiguration.cs | 42 + .../Models/TranscriptionTransportType.cs | 48 + ...articipantRequestInternal.Serialization.cs | 10 + .../TransferToParticipantRequestInternal.cs | 4 + ...articipantRequestInternal.Serialization.cs | 28 + .../UnholdParticipantRequestInternal.cs | 38 + .../src/Models/Events/CallTransferAccepted.cs | 5 + .../Models/Events/DialogSensitivityUpdate.cs | 4 - .../src/Models/HoldParticipantOptions.cs | 43 + ...g.cs => HoldParticipantRequestInternal.cs} | 4 +- .../UnholdParticipantRequestInternal.cs | 12 + .../src/Models/UnholdParticipantsOptions.cs | 31 + .../src/autorest.md | 4 +- .../src/swagger/common.json | 172 + .../src/swagger/swagger.json | 3918 +++++++++++++++++ 57 files changed, 5156 insertions(+), 116 deletions(-) create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingType.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.Serialization.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionTransportType.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs rename sdk/communication/Azure.Communication.CallAutomation/src/Models/{Events/SensitiveFlag.cs => HoldParticipantRequestInternal.cs} (55%) create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs index bfb0fedccfef..90e68579f972 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs @@ -388,6 +388,58 @@ public virtual Response StartRecognizing(CallMe } } + /// + /// Hold participant. + /// + /// The options. + /// + /// + public virtual async Task StartHoldMusicAsync(HoldParticipantOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusicAsync)}"); + scope.Start(); + try + { + var request = new HoldParticipantRequestInternal( + CommunicationIdentifierSerializer.Serialize(options.TargetParticipant), + TranslatePlaySourceToInternal(options.PlaySourceInfo)) + { + Loop = options.Loop, + OperationContext = options.OperationContext, + }; + + return await CallMediaRestClient.StartHoldMusicAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Hold participant. + /// + /// The options. + /// + /// + public virtual async Task UnholdParticipantAsync(UnholdParticipantsOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UnholdParticipantAsync)}"); + scope.Start(); + try + { + UnholdParticipantRequestInternal request = new UnholdParticipantRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + + return await CallMediaRestClient.StopHoldMusicAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecognizeOptions recognizeOptions) { if (recognizeOptions == null) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs index ea2dbc7df8c6..c731cf00f7fb 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs @@ -350,7 +350,7 @@ internal HttpMessage CreateGetParticipantsRequest(string callConnectionId) return message; } - /// Get participants from a call. + /// Get participants from a call. Recording and transcription bots are omitted from this list. /// The call connection Id. /// The cancellation token to use. /// is null. @@ -377,7 +377,7 @@ public async Task> GetParticipantsAsyn } } - /// Get participants from a call. + /// Get participants from a call. Recording and transcription bots are omitted from this list. /// The call connection Id. /// The cancellation token to use. /// is null. @@ -788,6 +788,102 @@ public Response Unmute(string callConnectionId, Unmu } } + internal HttpMessage CreateCancelAddParticipantRequest(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID, DateTimeOffset? repeatabilityFirstSent) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath("/participants:cancelAddParticipant", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (repeatabilityRequestID != null) + { + request.Headers.Add("Repeatability-Request-ID", repeatabilityRequestID.Value); + } + if (repeatabilityFirstSent != null) + { + request.Headers.Add("Repeatability-First-Sent", repeatabilityFirstSent.Value, "R"); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cancelAddParticipantRequest); + request.Content = content; + return message; + } + + /// Cancel add participant operation. + /// The call connection Id. + /// Cancellation request. + /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID. + /// If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + /// The cancellation token to use. + /// or is null. + public async Task> CancelAddParticipantAsync(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (cancelAddParticipantRequest == null) + { + throw new ArgumentNullException(nameof(cancelAddParticipantRequest)); + } + + using var message = CreateCancelAddParticipantRequest(callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + { + CancelAddParticipantResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CancelAddParticipantResponse.DeserializeCancelAddParticipantResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Cancel add participant operation. + /// The call connection Id. + /// Cancellation request. + /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID. + /// If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + /// The cancellation token to use. + /// or is null. + public Response CancelAddParticipant(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (cancelAddParticipantRequest == null) + { + throw new ArgumentNullException(nameof(cancelAddParticipantRequest)); + } + + using var message = CreateCancelAddParticipantRequest(callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + { + CancelAddParticipantResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CancelAddParticipantResponse.DeserializeCancelAddParticipantResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateGetParticipantRequest(string callConnectionId, string participantRawId) { var message = _pipeline.CreateMessage(); @@ -882,7 +978,7 @@ internal HttpMessage CreateGetParticipantsNextPageRequest(string nextLink, strin return message; } - /// Get participants from a call. + /// Get participants from a call. Recording and transcription bots are omitted from this list. /// The URL to the next page of results. /// The call connection Id. /// The cancellation token to use. @@ -914,7 +1010,7 @@ public async Task> GetParticipantsNext } } - /// Get participants from a call. + /// Get participants from a call. Recording and transcription bots are omitted from this list. /// The URL to the next page of results. /// The call connection Id. /// The cancellation token to use. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs index c518ab9f4cf0..3a69b4303c30 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs @@ -466,5 +466,153 @@ public Response SendDtmf(string callConnectionId, SendDtmfRequestInternal sendDt throw new RequestFailedException(message.Response); } } + + internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath(":startHoldMusic", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(holdParticipantRequest); + request.Content = content; + return message; + } + + /// Unmute participants from the call using identifier. + /// The call connection id. + /// The participants to be hold from the call. + /// The cancellation token to use. + /// or is null. + public async Task StartHoldMusicAsync(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (holdParticipantRequest == null) + { + throw new ArgumentNullException(nameof(holdParticipantRequest)); + } + + using var message = CreateStartHoldMusicRequest(callConnectionId, holdParticipantRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unmute participants from the call using identifier. + /// The call connection id. + /// The participants to be hold from the call. + /// The cancellation token to use. + /// or is null. + public Response StartHoldMusic(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (holdParticipantRequest == null) + { + throw new ArgumentNullException(nameof(holdParticipantRequest)); + } + + using var message = CreateStartHoldMusicRequest(callConnectionId, holdParticipantRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath(":stopHoldMusic", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(unholdParticipantRequest); + request.Content = content; + return message; + } + + /// Unmute participants from the call using identifier. + /// The call connection id. + /// The participants to be hold from the call. + /// The cancellation token to use. + /// or is null. + public async Task StopHoldMusicAsync(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (unholdParticipantRequest == null) + { + throw new ArgumentNullException(nameof(unholdParticipantRequest)); + } + + using var message = CreateStopHoldMusicRequest(callConnectionId, unholdParticipantRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unmute participants from the call using identifier. + /// The call connection id. + /// The participants to be hold from the call. + /// The cancellation token to use. + /// or is null. + public Response StopHoldMusic(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (unholdParticipantRequest == null) + { + throw new ArgumentNullException(nameof(unholdParticipantRequest)); + } + + using var message = CreateStopHoldMusicRequest(callConnectionId, unholdParticipantRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs index 2669c24bc143..2b2de72be5cd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs @@ -38,13 +38,23 @@ public static UnmuteParticipantsResponse UnmuteParticipantsResponse(string opera return new UnmuteParticipantsResponse(operationContext); } + /// Initializes a new instance of CancelAddParticipantResponse. + /// Invitation ID used to cancel the add participant action. + /// The operation context provided by client. + /// A new instance for mocking. + public static CancelAddParticipantResponse CancelAddParticipantResponse(string invitationId = null, string operationContext = null) + { + return new CancelAddParticipantResponse(invitationId, operationContext); + } + /// Initializes a new instance of RecordingStateResult. /// /// + /// /// A new instance for mocking. - public static RecordingStateResult RecordingStateResult(string recordingId = null, RecordingState? recordingState = null) + public static RecordingStateResult RecordingStateResult(string recordingId = null, RecordingState? recordingState = null, RecordingType? recordingType = null) { - return new RecordingStateResult(recordingId, recordingState); + return new RecordingStateResult(recordingId, recordingState, recordingType); } /// Initializes a new instance of ResultInformation. @@ -79,18 +89,6 @@ public static CallDisconnected CallDisconnected(string callConnectionId = null, return new CallDisconnected(callConnectionId, serverCallId, correlationId, operationContext); } - /// Initializes a new instance of CallTransferAccepted. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - /// A new instance for mocking. - public static CallTransferAccepted CallTransferAccepted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) - { - return new CallTransferAccepted(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); - } - /// Initializes a new instance of CallTransferFailed. /// Call connection ID. /// Server call ID. @@ -222,14 +220,6 @@ public static UserConsent UserConsent(int? recording = null) return new UserConsent(recording); } - /// Initializes a new instance of SensitiveFlag. - /// - /// A new instance for mocking. - public static SensitiveFlag SensitiveFlag(int? recording = null) - { - return new SensitiveFlag(recording); - } - /// Initializes a new instance of ContinuousDtmfRecognitionToneFailed. /// Call connection ID. /// Server call ID. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs new file mode 100644 index 000000000000..7b924d10c155 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Communication; + +namespace Azure.Communication.CallAutomation +{ + /// Successful cancel add participant event. + internal partial class AddParticipantCancelled + { + /// Initializes a new instance of AddParticipantCancelled. + internal AddParticipantCancelled() + { + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Participant that has been cancelled. + public CommunicationIdentifierModel Participant { get; } + /// Invitation ID used to cancel the request. + public string InvitiationId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs index ff69e3343153..1247be0dccd2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs @@ -42,6 +42,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("customContext"u8); writer.WriteObjectValue(CustomContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs index d4b91e3291a1..5953ac8580db 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs @@ -45,5 +45,7 @@ public AddParticipantRequestInternal(CommunicationIdentifierModel participantToA public string OperationContext { get; set; } /// Used by customer to send custom context to targets. public CustomContextInternal CustomContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.Serialization.cs index a56c0df43ad3..0425f6a84027 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.Serialization.cs @@ -20,6 +20,7 @@ internal static AddParticipantResponseInternal DeserializeAddParticipantResponse } Optional participant = default; Optional operationContext = default; + Optional invitiationId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("participant"u8)) @@ -36,8 +37,13 @@ internal static AddParticipantResponseInternal DeserializeAddParticipantResponse operationContext = property.Value.GetString(); continue; } + if (property.NameEquals("invitiationId"u8)) + { + invitiationId = property.Value.GetString(); + continue; + } } - return new AddParticipantResponseInternal(participant.Value, operationContext.Value); + return new AddParticipantResponseInternal(participant.Value, operationContext.Value, invitiationId.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.cs index 2c7c3242a9c1..feb67b6dd96b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantResponseInternal.cs @@ -18,15 +18,19 @@ internal AddParticipantResponseInternal() /// Initializes a new instance of AddParticipantResponseInternal. /// List of current participants in the call. /// The operation context provided by client. - internal AddParticipantResponseInternal(CallParticipantInternal participant, string operationContext) + /// Invitation ID used to add a participant. + internal AddParticipantResponseInternal(CallParticipantInternal participant, string operationContext, string invitiationId) { Participant = participant; OperationContext = operationContext; + InvitiationId = invitiationId; } /// List of current participants in the call. public CallParticipantInternal Participant { get; } /// The operation context provided by client. public string OperationContext { get; } + /// Invitation ID used to add a participant. + public string InvitiationId { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs index 2687ff70177a..f11777478d2d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs @@ -29,6 +29,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("mediaStreamingConfiguration"u8); writer.WriteObjectValue(MediaStreamingConfiguration); } + if (Optional.IsDefined(TranscriptionConfiguration)) + { + writer.WritePropertyName("transcriptionConfiguration"u8); + writer.WriteObjectValue(TranscriptionConfiguration); + } if (Optional.IsDefined(AzureCognitiveServicesEndpointUrl)) { writer.WritePropertyName("azureCognitiveServicesEndpointUrl"u8); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs index 52a98a9d01f2..5dc780871a5d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs @@ -35,6 +35,8 @@ public AnswerCallRequestInternal(string incomingCallContext, string callbackUri) public string OperationContext { get; set; } /// Media Streaming Configuration. public MediaStreamingOptionsInternal MediaStreamingConfiguration { get; set; } + /// Live Transcription Configuration. + public TranscriptionConfiguration TranscriptionConfiguration { get; set; } /// The endpoint URL of the Azure Cognitive Services resource attached. public string AzureCognitiveServicesEndpointUrl { get; set; } /// The identifier of the call automation entity which answers the call. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs index c423598401c6..9efba12cb9b9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs @@ -26,6 +26,7 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper Optional callConnectionState = default; Optional callbackUri = default; Optional mediaSubscriptionId = default; + Optional dataSubscriptionId = default; Optional sourceCallerIdNumber = default; Optional sourceDisplayName = default; Optional sourceIdentity = default; @@ -76,6 +77,11 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper mediaSubscriptionId = property.Value.GetString(); continue; } + if (property.NameEquals("dataSubscriptionId"u8)) + { + dataSubscriptionId = property.Value.GetString(); + continue; + } if (property.NameEquals("sourceCallerIdNumber"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -114,7 +120,7 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper continue; } } - return new CallConnectionPropertiesInternal(callConnectionId.Value, serverCallId.Value, Optional.ToList(targets), Optional.ToNullable(callConnectionState), callbackUri.Value, mediaSubscriptionId.Value, sourceCallerIdNumber.Value, sourceDisplayName.Value, sourceIdentity.Value, correlationId.Value, answeredByIdentifier.Value); + return new CallConnectionPropertiesInternal(callConnectionId.Value, serverCallId.Value, Optional.ToList(targets), Optional.ToNullable(callConnectionState), callbackUri.Value, mediaSubscriptionId.Value, dataSubscriptionId.Value, sourceCallerIdNumber.Value, sourceDisplayName.Value, sourceIdentity.Value, correlationId.Value, answeredByIdentifier.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs index 923217d55125..7decc5334736 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs @@ -27,6 +27,7 @@ internal CallConnectionPropertiesInternal() /// The state of the call connection. /// The callback URI. /// SubscriptionId for media streaming. + /// SubscriptionId for transcription. /// /// The source caller Id, a phone number, that's shown to the PSTN participant being invited. /// Required only when calling a PSTN callee. @@ -35,7 +36,7 @@ internal CallConnectionPropertiesInternal() /// Source identity. /// The correlation ID. /// Identity of the answering entity. Only populated when identity is provided in the request. - internal CallConnectionPropertiesInternal(string callConnectionId, string serverCallId, IReadOnlyList targets, CallConnectionState? callConnectionState, string callbackUri, string mediaSubscriptionId, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel sourceIdentity, string correlationId, CommunicationUserIdentifierModel answeredByIdentifier) + internal CallConnectionPropertiesInternal(string callConnectionId, string serverCallId, IReadOnlyList targets, CallConnectionState? callConnectionState, string callbackUri, string mediaSubscriptionId, string dataSubscriptionId, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel sourceIdentity, string correlationId, CommunicationUserIdentifierModel answeredByIdentifier) { CallConnectionId = callConnectionId; ServerCallId = serverCallId; @@ -43,6 +44,7 @@ internal CallConnectionPropertiesInternal(string callConnectionId, string server CallConnectionState = callConnectionState; CallbackUri = callbackUri; MediaSubscriptionId = mediaSubscriptionId; + DataSubscriptionId = dataSubscriptionId; SourceCallerIdNumber = sourceCallerIdNumber; SourceDisplayName = sourceDisplayName; SourceIdentity = sourceIdentity; @@ -62,6 +64,8 @@ internal CallConnectionPropertiesInternal(string callConnectionId, string server public string CallbackUri { get; } /// SubscriptionId for media streaming. public string MediaSubscriptionId { get; } + /// SubscriptionId for transcription. + public string DataSubscriptionId { get; } /// /// The source caller Id, a phone number, that's shown to the PSTN participant being invited. /// Required only when calling a PSTN callee. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.Serialization.cs index 5c4f2953a14c..2a36802a18e2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.Serialization.cs @@ -6,6 +6,7 @@ #nullable disable using System.Text.Json; +using Azure.Communication; using Azure.Core; namespace Azure.Communication.CallAutomation @@ -23,6 +24,8 @@ internal static CallTransferAccepted DeserializeCallTransferAccepted(JsonElement Optional correlationId = default; Optional operationContext = default; Optional resultInformation = default; + Optional transferTarget = default; + Optional transferee = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("callConnectionId"u8)) @@ -54,8 +57,26 @@ internal static CallTransferAccepted DeserializeCallTransferAccepted(JsonElement resultInformation = ResultInformation.DeserializeResultInformation(property.Value); continue; } + if (property.NameEquals("transferTarget"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transferTarget = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transferee"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transferee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } } - return new CallTransferAccepted(callConnectionId.Value, serverCallId.Value, correlationId.Value, operationContext.Value, resultInformation.Value); + return new CallTransferAccepted(callConnectionId.Value, serverCallId.Value, correlationId.Value, operationContext.Value, resultInformation.Value, transferTarget.Value, transferee.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.cs index 83b935164f5a..7c73a18cfa71 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAccepted.cs @@ -5,6 +5,8 @@ #nullable disable +using Azure.Communication; + namespace Azure.Communication.CallAutomation { /// The call transfer accepted event. @@ -21,13 +23,17 @@ internal CallTransferAccepted() /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Contains the resulting SIP code/sub-code and message from NGC services. - internal CallTransferAccepted(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + /// Traffer target: the user that transferee will be transferred to. + /// Transferee: the participant being transferred away. + internal CallTransferAccepted(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel transferTarget, CommunicationIdentifierModel transferee) { CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; OperationContext = operationContext; ResultInformation = resultInformation; + TransferTarget = transferTarget; + Transferee = transferee; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs new file mode 100644 index 000000000000..e5d426aa3cc6 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// Failed cancel add participant event. + internal partial class CancelAddParticipantFailed + { + /// Initializes a new instance of CancelAddParticipantFailed. + internal CancelAddParticipantFailed() + { + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code/sub-code and message from NGC services. + public ResultInformation ResultInformation { get; } + /// Invitation ID used to cancel the request. + public string InvitiationId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs new file mode 100644 index 000000000000..deab876b531a --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + public partial class CancelAddParticipantRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("invitiationId"u8); + writer.WriteStringValue(InvitiationId); + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs new file mode 100644 index 000000000000..a2621b74ea19 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The CancelAddParticipantRequest. + public partial class CancelAddParticipantRequest + { + /// Initializes a new instance of CancelAddParticipantRequest. + /// Invitation ID used to add a participant. + /// is null. + public CancelAddParticipantRequest(string invitiationId) + { + Argument.AssertNotNull(invitiationId, nameof(invitiationId)); + + InvitiationId = invitiationId; + } + + /// Invitation ID used to add a participant. + public string InvitiationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs new file mode 100644 index 000000000000..7c08c5b2b7a2 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + public partial class CancelAddParticipantResponse + { + internal static CancelAddParticipantResponse DeserializeCancelAddParticipantResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional invitationId = default; + Optional operationContext = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("invitationId"u8)) + { + invitationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + } + return new CancelAddParticipantResponse(invitationId.Value, operationContext.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs new file mode 100644 index 000000000000..fd4aac3e6cb8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The CancelAddParticipantResponse. + public partial class CancelAddParticipantResponse + { + /// Initializes a new instance of CancelAddParticipantResponse. + internal CancelAddParticipantResponse() + { + } + + /// Initializes a new instance of CancelAddParticipantResponse. + /// Invitation ID used to cancel the add participant action. + /// The operation context provided by client. + internal CancelAddParticipantResponse(string invitationId, string operationContext) + { + InvitationId = invitationId; + OperationContext = operationContext; + } + + /// Invitation ID used to cancel the add participant action. + public string InvitationId { get; } + /// The operation context provided by client. + public string OperationContext { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.Serialization.cs index ac39c2235b7a..2205d8a22d68 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.Serialization.cs @@ -22,6 +22,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.cs index 19ae1c327cf6..bc6188582a17 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionRequestInternal.cs @@ -28,5 +28,7 @@ public ContinuousDtmfRecognitionRequestInternal(CommunicationIdentifierModel tar public CommunicationIdentifierModel TargetParticipant { get; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs index 81b288e5932f..9f05c146f25a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs @@ -49,6 +49,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("mediaStreamingConfiguration"u8); writer.WriteObjectValue(MediaStreamingConfiguration); } + if (Optional.IsDefined(TranscriptionConfiguration)) + { + writer.WritePropertyName("transcriptionConfiguration"u8); + writer.WriteObjectValue(TranscriptionConfiguration); + } if (Optional.IsDefined(AzureCognitiveServicesEndpointUrl)) { writer.WritePropertyName("azureCognitiveServicesEndpointUrl"u8); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs index b7cd614b126f..778d8c1b0833 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs @@ -46,6 +46,8 @@ public CreateCallRequestInternal(IEnumerable targe public string CallbackUri { get; } /// Media Streaming Configuration. public MediaStreamingOptionsInternal MediaStreamingConfiguration { get; set; } + /// Live Transcription Configuration. + public TranscriptionConfiguration TranscriptionConfiguration { get; set; } /// The identifier of the Cognitive Service resource assigned to this call. public string AzureCognitiveServicesEndpointUrl { get; set; } /// Used by customer to send custom context to targets. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs index bee3edfb15a5..b0f18257b973 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs @@ -26,7 +26,7 @@ internal static DialogSensitivityUpdateInternal DeserializeDialogSensitivityUpda Optional resultInformation = default; Optional dialogInputType = default; Optional dialogId = default; - Optional sensitiveFlag = default; + Optional sensitiveMask = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("callConnectionId"u8)) @@ -72,17 +72,17 @@ internal static DialogSensitivityUpdateInternal DeserializeDialogSensitivityUpda dialogId = property.Value.GetString(); continue; } - if (property.NameEquals("sensitiveFlag"u8)) + if (property.NameEquals("sensitiveMask"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sensitiveFlag = SensitiveFlag.DeserializeSensitiveFlag(property.Value); + sensitiveMask = property.Value.GetBoolean(); continue; } } - return new DialogSensitivityUpdateInternal(callConnectionId.Value, serverCallId.Value, correlationId.Value, operationContext.Value, resultInformation.Value, Optional.ToNullable(dialogInputType), dialogId.Value, sensitiveFlag.Value); + return new DialogSensitivityUpdateInternal(callConnectionId.Value, serverCallId.Value, correlationId.Value, operationContext.Value, resultInformation.Value, Optional.ToNullable(dialogInputType), dialogId.Value, Optional.ToNullable(sensitiveMask)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs index 64660cc49ff1..683a379bab2e 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs @@ -25,8 +25,8 @@ internal DialogSensitivityUpdateInternal() /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. - /// SensitiveFlag data from the Conversation Conductor. - internal DialogSensitivityUpdateInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, SensitiveFlag sensitiveFlag) + /// SensitiveMask. + internal DialogSensitivityUpdateInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, bool? sensitiveMask) { CallConnectionId = callConnectionId; ServerCallId = serverCallId; @@ -35,7 +35,7 @@ internal DialogSensitivityUpdateInternal(string callConnectionId, string serverC ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; - SensitiveFlag = sensitiveFlag; + SensitiveMask = sensitiveMask; } /// Call connection ID. @@ -52,7 +52,7 @@ internal DialogSensitivityUpdateInternal(string callConnectionId, string serverC public DialogInputType? DialogInputType { get; } /// Dialog ID. public string DialogId { get; } - /// SensitiveFlag data from the Conversation Conductor. - public SensitiveFlag SensitiveFlag { get; } + /// SensitiveMask. + public bool? SensitiveMask { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs new file mode 100644 index 000000000000..19c44be94025 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + internal partial class HoldParticipantRequestInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("participantToHold"u8); + writer.WriteObjectValue(ParticipantToHold); + writer.WritePropertyName("playSourceInfo"u8); + writer.WriteObjectValue(PlaySourceInfo); + if (Optional.IsDefined(Loop)) + { + writer.WritePropertyName("loop"u8); + writer.WriteBooleanValue(Loop.Value); + } + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs new file mode 100644 index 000000000000..444bee9e528b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Communication; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The request payload for holding participant from the call. + internal partial class HoldParticipantRequestInternal + { + /// Initializes a new instance of HoldParticipantRequestInternal. + /// Participant to be held from the call. + /// Prompt to play while in hold. + /// or is null. + public HoldParticipantRequestInternal(CommunicationIdentifierModel participantToHold, PlaySourceInternal playSourceInfo) + { + Argument.AssertNotNull(participantToHold, nameof(participantToHold)); + Argument.AssertNotNull(playSourceInfo, nameof(playSourceInfo)); + + ParticipantToHold = participantToHold; + PlaySourceInfo = playSourceInfo; + } + + /// Participant to be held from the call. + public CommunicationIdentifierModel ParticipantToHold { get; } + /// Prompt to play while in hold. + public PlaySourceInternal PlaySourceInfo { get; } + /// If the prompt will be looped or not. + public bool? Loop { get; set; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.Serialization.cs index 54566a5d8cf4..143d2d58fee6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.Serialization.cs @@ -37,6 +37,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.cs index 2bd55cbfe78f..aa290fb3caa3 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayRequestInternal.cs @@ -32,5 +32,7 @@ public PlayRequestInternal(PlaySourceInternal playSourceInfo) public PlayOptionsInternal PlayOptions { get; set; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs index 8fa92a2c094e..f9734e52501c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs @@ -34,6 +34,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs index b3e6ae564d18..0e4fd7152ffe 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs @@ -35,5 +35,7 @@ public RecognizeRequestInternal(RecognizeInputType recognizeInputType, Recognize public RecognizeOptionsInternal RecognizeOptions { get; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.Serialization.cs index f65ac7a01b97..fa5a0efb0ea9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.Serialization.cs @@ -20,6 +20,7 @@ internal static RecordingStateResult DeserializeRecordingStateResult(JsonElement } Optional recordingId = default; Optional recordingState = default; + Optional recordingType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("recordingId"u8)) @@ -36,8 +37,17 @@ internal static RecordingStateResult DeserializeRecordingStateResult(JsonElement recordingState = new RecordingState(property.Value.GetString()); continue; } + if (property.NameEquals("recordingType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recordingType = new RecordingType(property.Value.GetString()); + continue; + } } - return new RecordingStateResult(recordingId.Value, Optional.ToNullable(recordingState)); + return new RecordingStateResult(recordingId.Value, Optional.ToNullable(recordingState), Optional.ToNullable(recordingType)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.cs index b9dd8af48a85..e5c1389e8638 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateResult.cs @@ -18,15 +18,19 @@ internal RecordingStateResult() /// Initializes a new instance of RecordingStateResult. /// /// - internal RecordingStateResult(string recordingId, RecordingState? recordingState) + /// + internal RecordingStateResult(string recordingId, RecordingState? recordingState, RecordingType? recordingType) { RecordingId = recordingId; RecordingState = recordingState; + RecordingType = recordingType; } /// Gets the recording id. public string RecordingId { get; } /// Gets the recording state. public RecordingState? RecordingState { get; } + /// Gets the recording type. + public RecordingType? RecordingType { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingType.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingType.cs new file mode 100644 index 000000000000..eebc2220d95e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// The RecordingType. + public readonly partial struct RecordingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RecordingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcsValue = "acs"; + private const string TeamsValue = "teams"; + + /// acs. + public static RecordingType Acs { get; } = new RecordingType(AcsValue); + /// teams. + public static RecordingType Teams { get; } = new RecordingType(TeamsValue); + /// Determines if two values are the same. + public static bool operator ==(RecordingType left, RecordingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RecordingType left, RecordingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RecordingType(string value) => new RecordingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RecordingType other && Equals(other); + /// + public bool Equals(RecordingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs index 44b0d4ab955f..73bdcc964717 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs @@ -22,6 +22,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs index d9ed55c1c915..b1b668e22eea 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs @@ -28,5 +28,7 @@ public RemoveParticipantRequestInternal(CommunicationIdentifierModel participant public CommunicationIdentifierModel ParticipantToRemove { get; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.Serialization.cs index da3ee3a717ca..eb1c265cbddf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.Serialization.cs @@ -29,6 +29,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.cs index 9aa6f1bd22d4..b08a0e1e5a68 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfRequestInternal.cs @@ -35,5 +35,7 @@ public SendDtmfRequestInternal(IEnumerable tones, CommunicationIdentif public CommunicationIdentifierModel TargetParticipant { get; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.Serialization.cs deleted file mode 100644 index 5d33b4ef1c88..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.Serialization.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - public partial class SensitiveFlag - { - internal static SensitiveFlag DeserializeSensitiveFlag(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional recording = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("recording"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - recording = property.Value.GetInt32(); - continue; - } - } - return new SensitiveFlag(Optional.ToNullable(recording)); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.cs deleted file mode 100644 index b74aad5ce7ce..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SensitiveFlag.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Communication.CallAutomation -{ - /// The SensitiveFlag. - public partial class SensitiveFlag - { - /// Initializes a new instance of SensitiveFlag. - internal SensitiveFlag() - { - } - - /// Initializes a new instance of SensitiveFlag. - /// - internal SensitiveFlag(int? recording) - { - Recording = recording; - } - - /// Gets the recording. - public int? Recording { get; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.Serialization.cs new file mode 100644 index 000000000000..57cf84d402eb --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.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.CallAutomation +{ + public partial class TranscriptionConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("transportUrl"u8); + writer.WriteStringValue(TransportUrl); + writer.WritePropertyName("transportType"u8); + writer.WriteStringValue(TransportType.ToString()); + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + writer.WritePropertyName("startTranscription"u8); + writer.WriteBooleanValue(StartTranscription); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.cs new file mode 100644 index 000000000000..c6a267d51b68 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionConfiguration.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// Configuration of live transcription. + public partial class TranscriptionConfiguration + { + /// Initializes a new instance of TranscriptionConfiguration. + /// Transport URL for live transcription. + /// The type of transport to be used for live transcription, eg. Websocket. + /// Defines the locale for the data e.g en-CA, en-AU. + /// Determines if the transcription should be started immediately after call is answered or not. + /// or is null. + public TranscriptionConfiguration(string transportUrl, TranscriptionTransportType transportType, string locale, bool startTranscription) + { + Argument.AssertNotNull(transportUrl, nameof(transportUrl)); + Argument.AssertNotNull(locale, nameof(locale)); + + TransportUrl = transportUrl; + TransportType = transportType; + Locale = locale; + StartTranscription = startTranscription; + } + + /// Transport URL for live transcription. + public string TransportUrl { get; } + /// The type of transport to be used for live transcription, eg. Websocket. + public TranscriptionTransportType TransportType { get; } + /// Defines the locale for the data e.g en-CA, en-AU. + public string Locale { get; } + /// Determines if the transcription should be started immediately after call is answered or not. + public bool StartTranscription { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionTransportType.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionTransportType.cs new file mode 100644 index 000000000000..4962a085de33 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionTransportType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// The type of transport to be used for live transcription, eg. Websocket. + public readonly partial struct TranscriptionTransportType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TranscriptionTransportType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WebsocketValue = "websocket"; + + /// websocket. + public static TranscriptionTransportType Websocket { get; } = new TranscriptionTransportType(WebsocketValue); + /// Determines if two values are the same. + public static bool operator ==(TranscriptionTransportType left, TranscriptionTransportType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TranscriptionTransportType left, TranscriptionTransportType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TranscriptionTransportType(string value) => new TranscriptionTransportType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TranscriptionTransportType other && Equals(other); + /// + public bool Equals(TranscriptionTransportType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs index fba8d206e681..4209a8a10b30 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs @@ -27,6 +27,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(Transferee)) + { + writer.WritePropertyName("transferee"u8); + writer.WriteObjectValue(Transferee); + } + if (Optional.IsDefined(CallbackUri)) + { + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs index baa6300ed5c7..0fdd0ceb227e 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs @@ -30,5 +30,9 @@ public TransferToParticipantRequestInternal(CommunicationIdentifierModel targetP public CustomContextInternal CustomContext { get; set; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } + /// Transferee is the participant who is transferring the call. + public CommunicationIdentifierModel Transferee { get; set; } + /// The callback URI to override the main callback URI. + public string CallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs new file mode 100644 index 000000000000..b2aff6c9aca8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + internal partial class UnholdParticipantRequestInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("participantToUnhold"u8); + writer.WriteObjectValue(ParticipantToUnhold); + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs new file mode 100644 index 000000000000..8ad0ab8bafa9 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Communication; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The request payload for holding participant from the call. + internal partial class UnholdParticipantRequestInternal + { + /// Initializes a new instance of UnholdParticipantRequestInternal. + /// + /// Participants to be hold from the call. + /// Only ACS Users are supported. + /// + /// is null. + public UnholdParticipantRequestInternal(CommunicationIdentifierModel participantToUnhold) + { + Argument.AssertNotNull(participantToUnhold, nameof(participantToUnhold)); + + ParticipantToUnhold = participantToUnhold; + } + + /// + /// Participants to be hold from the call. + /// Only ACS Users are supported. + /// + public CommunicationIdentifierModel ParticipantToUnhold { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs index 4367ddca65dd..dadfa0c36770 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs @@ -24,5 +24,10 @@ public static CallTransferAccepted Deserialize(string content) return DeserializeCallTransferAccepted(element); } + + /// Traffer target: the user that transferee will be transferred to. + internal CommunicationIdentifierModel TransferTarget { get; } + /// Transferee: the participant being transferred away. + internal CommunicationIdentifierModel Transferee { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/DialogSensitivityUpdate.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/DialogSensitivityUpdate.cs index 9c792d3038eb..3a97fc692637 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/DialogSensitivityUpdate.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/DialogSensitivityUpdate.cs @@ -27,7 +27,6 @@ internal DialogSensitivityUpdate(DialogSensitivityUpdateInternal internalEvent) OperationContext = internalEvent.OperationContext; ResultInformation = internalEvent.ResultInformation; DialogId = internalEvent.DialogId; - SensitiveFlag = internalEvent.SensitiveFlag; } /// Determines the type of the dialog. @@ -36,9 +35,6 @@ internal DialogSensitivityUpdate(DialogSensitivityUpdateInternal internalEvent) /// Dialog Id public string DialogId { get; } - /// SensitiveFlag data - public SensitiveFlag SensitiveFlag { get; } - /// /// Deserialize event. /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs new file mode 100644 index 000000000000..2c2399010e3f --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for the Unmute Participant Request. + /// + public class HoldParticipantOptions + { + /// + /// Creates a new UnmuteParticipantOptions object. + /// + public HoldParticipantOptions(CommunicationIdentifier targetParticipant) + { + TargetParticipant = targetParticipant; + } + + /// + /// The identity of participants to be held from the call. + /// + public CommunicationIdentifier TargetParticipant { get; } + + /// + /// Prompt to play while in hold. + /// + public PlaySource PlaySourceInfo { get; set; } + + /// + /// If the prompt will be looped or not. + /// + public bool Loop { get; set; } + + /// + /// The operation context to correlate the request to the response event. + /// + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs similarity index 55% rename from sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs index 5d5ee396e90c..6b9b99779d8f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs @@ -5,8 +5,8 @@ namespace Azure.Communication.CallAutomation { - [CodeGenModel("SensitiveFlag", Usage = new string[] { "output" }, Formats = new string[] { "json" })] - public partial class SensitiveFlag + [CodeGenModel("HoldParticipantRequest")] + internal partial class HoldParticipantRequestInternal { } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs new file mode 100644 index 000000000000..6020f3432910 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("UnholdParticipantRequest")] + internal partial class UnholdParticipantRequestInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs new file mode 100644 index 000000000000..7dd40aa55670 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for the Unmute Participant Request. + /// + public class UnholdParticipantsOptions + { + /// + /// Creates a new UnmuteParticipantOptions object. + /// + public UnholdParticipantsOptions(CommunicationIdentifier targetParticipant) + { + TargetParticipant = targetParticipant; + } + + /// + /// The identity of participants to be unmuted from the call. + /// Only one participant is currently supported. + /// Only ACS Users are currently supported. + /// + public CommunicationIdentifier TargetParticipant { get; } + + /// + /// The operation context. + /// + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index fec16352def8..e2ce50c383dd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -9,8 +9,8 @@ From Folder that contains autorest.md, Run `dotnet msbuild /t:GenerateCode` to g model-namespace: false tag: package-2023-01-15-preview -require: - - https://github.com/williamzhao87/azure-rest-api-specs/blob/e8612807fcc6148904e2ee316a2086a1db74f71c/specification/communication/data-plane/CallAutomation/readme.md +input-file: + - swagger/swagger.json title: Azure Communication Services diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json new file mode 100644 index 000000000000..a5b3fd88c562 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json @@ -0,0 +1,172 @@ +{ + "swagger": "2.0", + "info": { + "title": "Communication", + "description": "Communication Services API common types.", + "version": "2022-07-13" + }, + "paths": {}, + "definitions": { + "CommunicationErrorResponse": { + "description": "The Communication Services error.", + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "description": "The Communication Services error.", + "$ref": "#/definitions/CommunicationError" + } + } + }, + "CommunicationError": { + "description": "The Communication Services error.", + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The error message." + }, + "target": { + "type": "string", + "readOnly": true, + "description": "The error target." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationError" + }, + "readOnly": true, + "description": "Further details about specific errors that led to this error." + }, + "innererror": { + "x-ms-client-name": "innerError", + "readOnly": true, + "$ref": "#/definitions/CommunicationError", + "description": "The inner error if any." + } + } + }, + "CommunicationCloudEnvironmentModel": { + "description": "The cloud that the identifier belongs to.", + "type": "string", + "enum": [ + "public", + "dod", + "gcch" + ], + "x-ms-enum": { + "name": "CommunicationCloudEnvironmentModel", + "modelAsString": true + } + }, + "CommunicationIdentifierModelKind": { + "description": "The identifier kind, for example 'communicationUser' or 'phoneNumber'.", + "type": "string", + "enum": [ + "unknown", + "communicationUser", + "phoneNumber", + "microsoftTeamsUser" + ], + "x-ms-enum": { + "name": "CommunicationIdentifierModelKind", + "modelAsString": true + } + }, + "CommunicationIdentifierModel": { + "description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model is polymorphic: Apart from kind and rawId, at most one further property may be set which must match the kind enum value.", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/CommunicationIdentifierModelKind", + "description": "The identifier kind. Only required in responses." + }, + "rawId": { + "type": "string", + "description": "Raw Id of the identifier. Optional in requests, required in responses." + }, + "communicationUser": { + "$ref": "#/definitions/CommunicationUserIdentifierModel", + "description": "The communication user." + }, + "phoneNumber": { + "$ref": "#/definitions/PhoneNumberIdentifierModel", + "description": "The phone number." + }, + "microsoftTeamsUser": { + "$ref": "#/definitions/MicrosoftTeamsUserIdentifierModel", + "description": "The Microsoft Teams user." + } + } + }, + "CommunicationUserIdentifierModel": { + "description": "A user that got created with an Azure Communication Services resource.", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Id of the communication user." + } + } + }, + "PhoneNumberIdentifierModel": { + "description": "A phone number.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The phone number in E.164 format." + } + } + }, + "MicrosoftTeamsUserIdentifierModel": { + "description": "A Microsoft Teams user.", + "type": "object", + "required": [ + "userId" + ], + "properties": { + "userId": { + "type": "string", + "description": "The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user." + }, + "isAnonymous": { + "type": "boolean", + "description": "True if the Microsoft Teams user is anonymous. By default false if missing." + }, + "cloud": { + "$ref": "#/definitions/CommunicationCloudEnvironmentModel", + "description": "The cloud that the Microsoft Teams user belongs to. By default 'public' if missing." + } + } + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json new file mode 100644 index 000000000000..6d2f878722f0 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json @@ -0,0 +1,3918 @@ +{ + "swagger": "2.0", + "info": { + "version": "2023-01-15-preview", + "title": "Azure Communication Service Call Automation APIs", + "description": "Azure Communication Service Call Automation APIs" + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/calling/callConnections": { + "post": { + "tags": [ + "PreConnections" + ], + "summary": "Create an outbound call.", + "description": "Create an outbound call.", + "operationId": "CreateCall", + "parameters": [ + { + "name": "createCallRequest", + "in": "body", + "description": "The create call request.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCallRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "201": { + "description": "Returns details of the call properties once the CreateCall request is received by service. You will receive CallConnected event at your specified callback URI, once the call is connected.", + "schema": { + "$ref": "#/definitions/CallConnectionProperties" + } + } + }, + "x-ms-examples": { + "CreateCall": { + "$ref": "./examples/CreateCall.json" + } + } + } + }, + "/calling/callConnections:answer": { + "post": { + "tags": [ + "PreConnections" + ], + "summary": "Answer a Call.", + "description": "Answer a call using the IncomingCallContext from Event Grid.", + "operationId": "AnswerCall", + "parameters": [ + { + "name": "answerCallRequest", + "in": "body", + "description": "The answer call request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnswerCallRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns details of the call properties once the AnswerCall request is received by service. You will receive CallConnected event at your specified callback URI, once the call is connected.", + "schema": { + "$ref": "#/definitions/CallConnectionProperties" + } + } + }, + "x-ms-examples": { + "AnswerCall": { + "$ref": "./examples/AnswerCall.json" + } + } + } + }, + "/calling/callConnections:redirect": { + "post": { + "tags": [ + "PreConnections" + ], + "summary": "Redirect a call.", + "description": "Redirect a call.", + "operationId": "RedirectCall", + "parameters": [ + { + "name": "redirectCallRequest", + "in": "body", + "description": "The redirect call request.", + "required": true, + "schema": { + "$ref": "#/definitions/RedirectCallRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "The service has redirected the call to specified endpoint." + } + }, + "x-ms-examples": { + "RedirectCall": { + "$ref": "./examples/RedirectCall.json" + } + } + } + }, + "/calling/callConnections:reject": { + "post": { + "tags": [ + "PreConnections" + ], + "summary": "Reject the call.", + "description": "Reject the call.", + "operationId": "RejectCall", + "parameters": [ + { + "name": "rejectCallRequest", + "in": "body", + "description": "The reject call request.", + "required": true, + "schema": { + "$ref": "#/definitions/RejectCallRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "The service has rejected the call." + } + }, + "x-ms-examples": { + "RejectCall": { + "$ref": "./examples/RejectCall.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}": { + "get": { + "tags": [ + "MidConnections" + ], + "summary": "Get call connection.", + "operationId": "CallConnection_GetCall", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns details of the call properties.", + "schema": { + "$ref": "#/definitions/CallConnectionProperties" + } + } + }, + "x-ms-examples": { + "CallConnection_GetCall": { + "$ref": "./examples/CallConnection_GetCall.json" + } + } + }, + "delete": { + "tags": [ + "MidConnections" + ], + "summary": "Hangup the call.", + "description": "Hangup the call.", + "operationId": "CallConnection_HangupCall", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Call automation service has left the call." + } + }, + "x-ms-examples": { + "CallConnection_HangupCall": { + "$ref": "./examples/CallConnection_HangupCall.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:terminate": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Terminate a call using CallConnectionId.", + "description": "Terminate a call using CallConnectionId.", + "operationId": "CallConnection_TerminateCall", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The terminate call request.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "The call is terminated." + } + }, + "x-ms-examples": { + "CallConnection_TerminateCall": { + "$ref": "./examples/CallConnection_TerminateCall.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:transferToParticipant": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Transfer the call to a participant.", + "description": "Transfer the call to a participant.", + "operationId": "CallConnection_TransferToParticipant", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "transferToParticipantRequest", + "in": "body", + "description": "The transfer to participant request.", + "required": true, + "schema": { + "$ref": "#/definitions/TransferToParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the transfer request and will begin processing it. You will receive either CallTransferAccepted or CallTransferFailed event at your specified callback URI to update you on the status of the request.", + "schema": { + "$ref": "#/definitions/TransferCallResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_TransferToParticipant": { + "$ref": "./examples/CallConnection_TransferToParticipant.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:play": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Plays audio to participants in the call.", + "description": "Plays audio to participants in the call.", + "operationId": "CallMedia_Play", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "playRequest", + "in": "body", + "description": "play request payload.", + "required": true, + "schema": { + "$ref": "#/definitions/PlayRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the play request and will begin processing it. You will receive either PlayCompleted or PlayFailed event at your specified callback URI to update you on the status of the request." + } + }, + "x-ms-examples": { + "CallMedia_Play": { + "$ref": "./examples/CallMedia_Play.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:cancelAllMediaOperations": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Cancel all media operations in a call.", + "description": "Cancel all media operations in a call.", + "operationId": "CallMedia_CancelAllMediaOperations", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the cancel request and will begin processing it. RecognizeCanceled and/or PlayCanceled at your specified callback URI to update you on the status of the request, based on which media operation has been canceled by it." + } + }, + "x-ms-examples": { + "CallMedia_CancelAllMediaOperations": { + "$ref": "./examples/CallMedia_CancelAllMediaOperations.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:recognize": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Recognize media from call.", + "description": "Recognize media from call.", + "operationId": "CallMedia_Recognize", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "recognizeRequest", + "in": "body", + "description": "The media recognize request", + "required": true, + "schema": { + "$ref": "#/definitions/RecognizeRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the recognize request and will begin processing it. You will receive either RecognizeCompleted or RecognizeFailed event at your specified callback URI to update you on the status of the request." + } + }, + "x-ms-examples": { + "CallMedia_Recognize": { + "$ref": "./examples/CallMedia_Recognize.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:startContinuousDtmfRecognition": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Start continuous Dtmf recognition by subscribing to tones.", + "operationId": "CallMedia_StartContinuousDtmfRecognition", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "continuousDtmfRecognitionRequest", + "in": "body", + "description": "The continuous recognize request", + "required": true, + "schema": { + "$ref": "#/definitions/ContinuousDtmfRecognitionRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "The service has accepted the start continuous recognize request and will begin processing it. You will receive events at your specified callback URI to update you on the status of the request." + } + }, + "x-ms-examples": { + "CallMedia_StartContinuousDtmfRecognition": { + "$ref": "./examples/CallMedia_StartContinuousDtmfRecognition.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:stopContinuousDtmfRecognition": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Stop continuous Dtmf recognition by unsubscribing to tones.", + "operationId": "CallMedia_StopContinuousDtmfRecognition", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "continuousDtmfRecognitionRequest", + "in": "body", + "description": "The continuous recognize request", + "required": true, + "schema": { + "$ref": "#/definitions/ContinuousDtmfRecognitionRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "The service has accepted the stop continuous recognize request and will begin processing it. You will receive events at your specified callback URI to update you on the status of the request." + } + }, + "x-ms-examples": { + "CallMedia_StopContinuousDtmfRecognition": { + "$ref": "./examples/CallMedia_StopContinuousDtmfRecognition.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:sendDtmf": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Send dtmf tones.", + "description": "Send dtmf tones.", + "operationId": "CallMedia_SendDtmf", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "sendDtmfRequest", + "in": "body", + "description": "The send dtmf request", + "required": true, + "schema": { + "$ref": "#/definitions/SendDtmfRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "Returns the send dtmf response" + } + }, + "x-ms-examples": { + "CallMedia_SendDtmf": { + "$ref": "./examples/CallMedia_SendDtmf.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:startHoldMusic": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Unmute participants from the call using identifier.", + "description": "Unmute participants from the call using identifier.", + "operationId": "CallMedia_StartHoldMusic", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "holdParticipantRequest", + "in": "body", + "description": "The participants to be hold from the call.", + "required": true, + "schema": { + "$ref": "#/definitions/HoldParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the hold participant response" + } + }, + "x-ms-examples": { + "CallMedia_StartHoldMusic": { + "$ref": "./examples/CallMedia_StartHoldMusic.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}:stopHoldMusic": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Unmute participants from the call using identifier.", + "description": "Unmute participants from the call using identifier.", + "operationId": "CallMedia_StopHoldMusic", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "unholdParticipantRequest", + "in": "body", + "description": "The participants to be hold from the call.", + "required": true, + "schema": { + "$ref": "#/definitions/UnholdParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the unhold participant response" + } + }, + "x-ms-examples": { + "CallMedia_StopHoldMusic": { + "$ref": "./examples/CallMedia_StopHoldMusic.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/dialogs/{dialogId}": { + "put": { + "tags": [ + "MidConnections" + ], + "summary": "Start a dialog targeting a particular participant on the call.", + "description": "Start a dialog.", + "operationId": "CallDialog_StartDialog", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "dialogId", + "in": "path", + "description": "The dialog id", + "required": true, + "type": "string" + }, + { + "name": "startDialogRequest", + "in": "body", + "description": "The start dialog request", + "required": true, + "schema": { + "$ref": "#/definitions/StartDialogRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "201": { + "description": "Returns the start dialog response.", + "schema": { + "$ref": "#/definitions/DialogStateResponse" + } + } + }, + "x-ms-examples": { + "CallDialog_StartDialog": { + "$ref": "./examples/CallDialog_StartDialog.json" + } + } + }, + "delete": { + "tags": [ + "MidConnections" + ], + "summary": "Stop a dialog.", + "description": "Stop a dialog.", + "operationId": "CallDialog_StopDialog", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id", + "required": true, + "type": "string" + }, + { + "name": "dialogId", + "in": "path", + "description": "The dialog id", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Returns no content for stop dialog response." + } + }, + "x-ms-examples": { + "CallDialog_StopDialog": { + "$ref": "./examples/CallDialog_StopDialog.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants": { + "get": { + "tags": [ + "MidConnections" + ], + "summary": "Get participants from a call. Recording and transcription bots are omitted from this list.", + "description": "Get participants from a call. Recording and transcription bots are omitted from this list.", + "operationId": "CallConnection_GetParticipants", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection Id", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the get participants response.", + "schema": { + "$ref": "#/definitions/GetParticipantsResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_GetParticipants": { + "$ref": "./examples/CallConnection_GetParticipants.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "values" + } + } + }, + "/calling/callConnections/{callConnectionId}/participants:add": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Add participants to the call.", + "description": "Add participants to the call.", + "operationId": "CallConnection_AddParticipant", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection Id", + "required": true, + "type": "string" + }, + { + "name": "addParticipantRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the add participant request and will begin processing it. You will receive either AddParticipantSucceeded or AddParticipantFailed event at your specified callback URI to update you on the status of the request.", + "schema": { + "$ref": "#/definitions/AddParticipantResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_AddParticipant": { + "$ref": "./examples/CallConnection_AddParticipant.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants:remove": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Remove participant from the call using identifier.", + "description": "Remove participant from the call using identifier.", + "operationId": "CallConnection_RemoveParticipant", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "removeParticipantRequest", + "in": "body", + "description": "The participant to be removed from the call.", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the remove participant request and will begin processing it. You will receive either RemoveParticipantSucceeded or RemoveParticipantFailed event at your specified callback URI to update you on the status of the request.", + "schema": { + "$ref": "#/definitions/RemoveParticipantResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_RemoveParticipant": { + "$ref": "./examples/CallConnection_RemoveParticipant.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants:mute": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Mute participants from the call using identifier.", + "description": "Mute participants from the call using identifier.", + "operationId": "CallConnection_Mute", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "muteParticipantsRequest", + "in": "body", + "description": "The participants to be muted from the call.", + "required": true, + "schema": { + "$ref": "#/definitions/MuteParticipantsRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "Returns the mute participants response", + "schema": { + "$ref": "#/definitions/MuteParticipantsResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_Mute": { + "$ref": "./examples/CallConnection_Mute.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants:unmute": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Unmute participants from the call using identifier.", + "description": "Unmute participants from the call using identifier.", + "operationId": "CallConnection_Unmute", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection id.", + "required": true, + "type": "string" + }, + { + "name": "unmuteParticipantsRequest", + "in": "body", + "description": "The participants to be unmuted from the call.", + "required": true, + "schema": { + "$ref": "#/definitions/UnmuteParticipantsRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "Returns the unmute participants response", + "schema": { + "$ref": "#/definitions/UnmuteParticipantsResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_Unmute": { + "$ref": "./examples/CallConnection_Unmute.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants:cancelAddParticipant": { + "post": { + "tags": [ + "MidConnections" + ], + "summary": "Cancel add participant operation.", + "description": "Cancel add participant operation.", + "operationId": "CallConnection_CancelAddParticipant", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection Id", + "required": true, + "type": "string" + }, + { + "name": "cancelAddParticipantRequest", + "in": "body", + "description": "Cancellation request.", + "required": true, + "schema": { + "$ref": "#/definitions/CancelAddParticipantRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "Returns the cancelAddParticipant response", + "schema": { + "$ref": "#/definitions/CancelAddParticipantResponse" + } + } + }, + "x-ms-examples": { + "CallConnection_CancelAddParticipant": { + "$ref": "./examples/CallConnection_CancelAddParticipant.json" + } + } + } + }, + "/calling/callConnections/{callConnectionId}/participants/{participantRawId}": { + "get": { + "tags": [ + "MidConnections" + ], + "summary": "Get participant from a call.", + "description": "Get participant from a call.", + "operationId": "CallConnection_GetParticipant", + "parameters": [ + { + "name": "callConnectionId", + "in": "path", + "description": "The call connection Id", + "required": true, + "type": "string" + }, + { + "name": "participantRawId", + "in": "path", + "description": "Raw id of the participant to retrieve.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the detail of the requested participant.", + "schema": { + "$ref": "#/definitions/CallParticipant" + } + } + }, + "x-ms-examples": { + "CallConnection_GetParticipant": { + "$ref": "./examples/CallConnection_GetParticipant.json" + } + } + } + }, + "/calling/recordings": { + "post": { + "tags": [ + "Recording" + ], + "summary": "Start recording the call.", + "operationId": "CallRecording_StartRecording", + "parameters": [ + { + "name": "startCallRecording", + "in": "body", + "description": "The request body of start call recording request.", + "required": true, + "schema": { + "$ref": "#/definitions/StartCallRecordingRequest" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", + "type": "string", + "format": "uuid" + }, + { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", + "type": "string", + "format": "date-time-rfc1123" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the start call recording response.", + "schema": { + "$ref": "#/definitions/RecordingStateResponse" + } + } + }, + "x-ms-examples": { + "CallRecording_StartRecording": { + "$ref": "./examples/CallRecording_StartRecording.json" + } + } + } + }, + "/calling/recordings/{recordingId}": { + "get": { + "tags": [ + "Recording" + ], + "summary": "Get call recording properties.", + "operationId": "CallRecording_GetRecordingProperties", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "The recording id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Returns the recording properties.", + "schema": { + "$ref": "#/definitions/RecordingStateResponse" + } + } + }, + "x-ms-examples": { + "CallRecording_GetRecordingProperties": { + "$ref": "./examples/CallRecording_GetRecordingProperties.json" + } + } + }, + "delete": { + "tags": [ + "Recording" + ], + "summary": "Stop recording the call.", + "operationId": "CallRecording_StopRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "The recording id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Returns the stop call recording response." + } + }, + "x-ms-examples": { + "CallRecording_StopRecording": { + "$ref": "./examples/CallRecording_StopRecording.json" + } + } + } + }, + "/calling/recordings/{recordingId}:pause": { + "post": { + "tags": [ + "Recording" + ], + "summary": "Pause recording the call.", + "operationId": "CallRecording_PauseRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "The recording id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the pause request and will begin processing it." + } + }, + "x-ms-examples": { + "CallRecording_PauseRecording": { + "$ref": "./examples/CallRecording_PauseRecording.json" + } + } + } + }, + "/calling/recordings/{recordingId}:resume": { + "post": { + "tags": [ + "Recording" + ], + "summary": "Resume recording the call.", + "operationId": "CallRecording_ResumeRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "The recording id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "202": { + "description": "The service has accepted the resume request and will begin processing it." + } + }, + "x-ms-examples": { + "CallRecording_ResumeRecording": { + "$ref": "./examples/CallRecording_ResumeRecording.json" + } + } + } + } + }, + "definitions": { + "CreateCallRequest": { + "description": "The request payload for creating the call.", + "required": [ + "targets", + "callbackUri" + ], + "type": "object", + "properties": { + "targets": { + "description": "The targets of the call.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "sourceCallerIdNumber": { + "$ref": "#/definitions/PhoneNumberIdentifierModel", + "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when calling a PSTN callee." + }, + "sourceDisplayName": { + "description": "Display name of the call if dialing out to a pstn number", + "type": "string" + }, + "sourceIdentity": { + "$ref": "#/definitions/CommunicationUserIdentifierModel", + "description": "The identifier of the source of the call" + }, + "operationContext": { + "description": "A customer set value used to track the answering of a call.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI.", + "type": "string" + }, + "mediaStreamingConfiguration": { + "$ref": "#/definitions/MediaStreamingConfiguration", + "description": "Media Streaming Configuration." + }, + "transcriptionConfiguration": { + "$ref": "#/definitions/TranscriptionConfiguration", + "description": "Live Transcription Configuration." + }, + "azureCognitiveServicesEndpointUrl": { + "description": "The identifier of the Cognitive Service resource assigned to this call.", + "type": "string" + }, + "customContext": { + "$ref": "#/definitions/CustomContext", + "description": "Used by customer to send custom context to targets" + } + } + }, + "CommunicationIdentifierModel": { + "$ref": "common.json#/definitions/CommunicationIdentifierModel" + }, + "PhoneNumberIdentifierModel": { + "$ref": "common.json#/definitions/PhoneNumberIdentifierModel" + }, + "CommunicationUserIdentifierModel": { + "$ref": "common.json#/definitions/CommunicationUserIdentifierModel" + }, + "MediaStreamingTransportType": { + "description": "The type of transport to be used for media streaming, eg. Websocket", + "enum": [ + "websocket" + ], + "type": "string", + "x-ms-enum": { + "name": "MediaStreamingTransportType", + "modelAsString": true + } + }, + "MediaStreamingContentType": { + "description": "Content type to stream, eg. audio, audio/video", + "enum": [ + "audio" + ], + "type": "string", + "x-ms-enum": { + "name": "MediaStreamingContentType", + "modelAsString": true + } + }, + "MediaStreamingAudioChannelType": { + "description": "Audio channel type to stream, eg. unmixed audio, mixed audio", + "enum": [ + "mixed", + "unmixed" + ], + "type": "string", + "x-ms-enum": { + "name": "MediaStreamingAudioChannelType", + "modelAsString": true + } + }, + "MediaStreamingConfiguration": { + "description": "Configuration of Media streaming.", + "required": [ + "transportUrl", + "transportType", + "contentType", + "audioChannelType" + ], + "type": "object", + "properties": { + "transportUrl": { + "description": "Transport URL for media streaming", + "type": "string" + }, + "transportType": { + "$ref": "#/definitions/MediaStreamingTransportType" + }, + "contentType": { + "$ref": "#/definitions/MediaStreamingContentType" + }, + "audioChannelType": { + "$ref": "#/definitions/MediaStreamingAudioChannelType" + } + } + }, + "TranscriptionTransportType": { + "description": "The type of transport to be used for live transcription, eg. Websocket", + "enum": [ + "websocket" + ], + "type": "string", + "x-ms-enum": { + "name": "TranscriptionTransportType", + "modelAsString": true + } + }, + "TranscriptionConfiguration": { + "description": "Configuration of live transcription.", + "required": [ + "transportUrl", + "transportType", + "locale", + "startTranscription" + ], + "type": "object", + "properties": { + "transportUrl": { + "description": "Transport URL for live transcription", + "type": "string" + }, + "transportType": { + "$ref": "#/definitions/TranscriptionTransportType" + }, + "locale": { + "description": "Defines the locale for the data e.g en-CA, en-AU", + "type": "string" + }, + "startTranscription": { + "description": "Determines if the transcription should be started immediately after call is answered or not.", + "type": "boolean" + } + } + }, + "CustomContext": { + "type": "object", + "properties": { + "voipHeaders": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "sipHeaders": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "CommunicationErrorResponse": { + "$ref": "common.json#/definitions/CommunicationErrorResponse" + }, + "CallConnectionStateModel": { + "description": "The state of the call connection.", + "enum": [ + "unknown", + "connecting", + "connected", + "transferring", + "transferAccepted", + "disconnecting", + "disconnected" + ], + "type": "string", + "x-ms-enum": { + "name": "CallConnectionStateModel", + "modelAsString": true + } + }, + "CallConnectionProperties": { + "description": "Properties of a call connection", + "type": "object", + "properties": { + "callConnectionId": { + "description": "The call connection id.", + "type": "string" + }, + "serverCallId": { + "description": "The server call id.", + "type": "string" + }, + "targets": { + "description": "The targets of the call.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "callConnectionState": { + "$ref": "#/definitions/CallConnectionStateModel" + }, + "callbackUri": { + "description": "The callback URI.", + "type": "string" + }, + "mediaSubscriptionId": { + "description": "SubscriptionId for media streaming", + "type": "string" + }, + "dataSubscriptionId": { + "description": "SubscriptionId for transcription", + "type": "string" + }, + "sourceCallerIdNumber": { + "$ref": "#/definitions/PhoneNumberIdentifierModel", + "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when calling a PSTN callee." + }, + "sourceDisplayName": { + "description": "Display name of the call if dialing out to a pstn number.", + "type": "string" + }, + "sourceIdentity": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Source identity." + }, + "correlationId": { + "description": "The correlation ID.", + "type": "string" + }, + "answeredByIdentifier": { + "$ref": "#/definitions/CommunicationUserIdentifierModel", + "description": "Identity of the answering entity. Only populated when identity is provided in the request." + } + } + }, + "AnswerCallRequest": { + "description": "The request payload for answering the call.", + "required": [ + "incomingCallContext", + "callbackUri" + ], + "type": "object", + "properties": { + "incomingCallContext": { + "description": "The context associated with the call.", + "type": "string" + }, + "callbackUri": { + "description": "The callback uri.", + "type": "string" + }, + "operationContext": { + "description": "A customer set value used to track the answering of a call.", + "type": "string" + }, + "mediaStreamingConfiguration": { + "$ref": "#/definitions/MediaStreamingConfiguration", + "description": "Media Streaming Configuration." + }, + "transcriptionConfiguration": { + "$ref": "#/definitions/TranscriptionConfiguration", + "description": "Live Transcription Configuration." + }, + "azureCognitiveServicesEndpointUrl": { + "description": "The endpoint URL of the Azure Cognitive Services resource attached", + "type": "string" + }, + "answeredByIdentifier": { + "$ref": "#/definitions/CommunicationUserIdentifierModel", + "description": "The identifier of the call automation entity which answers the call" + } + } + }, + "RedirectCallRequest": { + "description": "The request payload for redirecting the call.", + "required": [ + "incomingCallContext", + "target" + ], + "type": "object", + "properties": { + "incomingCallContext": { + "description": "The context associated with the call.", + "type": "string" + }, + "target": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The target identity to redirect the call to." + }, + "customContext": { + "$ref": "#/definitions/CustomContext", + "description": "Used by customer to send custom context to targets" + } + } + }, + "CallRejectReason": { + "description": "The rejection reason.", + "enum": [ + "none", + "busy", + "forbidden" + ], + "type": "string", + "x-ms-enum": { + "name": "CallRejectReason", + "modelAsString": true + } + }, + "RejectCallRequest": { + "description": "The request payload for rejecting the call.", + "required": [ + "incomingCallContext" + ], + "type": "object", + "properties": { + "incomingCallContext": { + "description": "The context associated with the call.", + "type": "string" + }, + "callRejectReason": { + "$ref": "#/definitions/CallRejectReason" + } + } + }, + "TransferToParticipantRequest": { + "description": "The request payload for transferring call to a participant.", + "required": [ + "targetParticipant" + ], + "type": "object", + "properties": { + "targetParticipant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The identity of the target where call should be transferred to." + }, + "customContext": { + "$ref": "#/definitions/CustomContext", + "description": "Used by customer to send custom context to targets" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "transferee": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Transferee is the participant who is transferring the call." + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "TransferCallResponse": { + "description": "The response payload for transferring the call.", + "type": "object", + "properties": { + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + } + } + }, + "PlayRequest": { + "required": [ + "playSourceInfo" + ], + "type": "object", + "properties": { + "playSourceInfo": { + "$ref": "#/definitions/PlaySource", + "description": "The source of the audio to be played." + }, + "playTo": { + "description": "The list of call participants play provided audio to.\r\nPlays to everyone in the call when not provided.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "playOptions": { + "$ref": "#/definitions/PlayOptions", + "description": "Defines options for playing the audio." + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "PlaySourceType": { + "description": "Defines the type of the play source", + "enum": [ + "file", + "text", + "ssml" + ], + "type": "string", + "x-ms-enum": { + "name": "PlaySourceType", + "modelAsString": true + } + }, + "PlaySource": { + "required": [ + "sourceType" + ], + "type": "object", + "properties": { + "sourceType": { + "$ref": "#/definitions/PlaySourceType" + }, + "playSourceId": { + "description": "Defines the identifier to be used for caching related media", + "type": "string" + }, + "fileSource": { + "$ref": "#/definitions/FileSource", + "description": "Defines the file source info to be used for play" + }, + "textSource": { + "$ref": "#/definitions/TextSource", + "description": "Defines the text source info to be used for play" + }, + "ssmlSource": { + "$ref": "#/definitions/SsmlSource", + "description": "Defines the ssml(Speech Synthesis Markup Language) source info to be used for play" + } + } + }, + "PlayOptions": { + "required": [ + "loop" + ], + "type": "object", + "properties": { + "loop": { + "description": "The option to play the provided audio source in loop when set to true", + "type": "boolean" + } + } + }, + "FileSource": { + "required": [ + "uri" + ], + "type": "object", + "properties": { + "uri": { + "description": "Uri for the audio file to be played", + "type": "string" + } + } + }, + "Gender": { + "description": "Voice gender type", + "enum": [ + "male", + "female" + ], + "type": "string", + "x-ms-enum": { + "name": "Gender", + "modelAsString": true + } + }, + "TextSource": { + "required": [ + "text" + ], + "type": "object", + "properties": { + "text": { + "description": "Text for the cognitive service to be played", + "type": "string" + }, + "sourceLocale": { + "description": "Source language locale to be played\r\nRefer to available locales here: ", + "type": "string" + }, + "voiceGender": { + "$ref": "#/definitions/Gender" + }, + "voiceName": { + "description": "Voice name to be played\r\nRefer to available Text-to-speech voices here: ", + "type": "string" + }, + "customVoiceEndpointId": { + "description": "Endpoint where the custom voice was deployed.", + "type": "string" + } + } + }, + "SsmlSource": { + "required": [ + "ssmlText" + ], + "type": "object", + "properties": { + "ssmlText": { + "description": "Ssml string for the cognitive service to be played", + "type": "string" + }, + "customVoiceEndpointId": { + "description": "Endpoint where the custom voice was deployed.", + "type": "string" + } + } + }, + "RecognizeInputType": { + "description": "Determines the type of the recognition.", + "enum": [ + "dtmf", + "speech", + "speechOrDtmf", + "choices" + ], + "type": "string", + "x-ms-enum": { + "name": "RecognizeInputType", + "modelAsString": true + } + }, + "RecognizeRequest": { + "required": [ + "recognizeInputType", + "recognizeOptions" + ], + "type": "object", + "properties": { + "recognizeInputType": { + "$ref": "#/definitions/RecognizeInputType" + }, + "playPrompt": { + "$ref": "#/definitions/PlaySource", + "description": "The source of the audio to be played for recognition." + }, + "interruptCallMediaOperation": { + "description": "If set recognize can barge into other existing queued-up/currently-processing requests.", + "type": "boolean" + }, + "recognizeOptions": { + "$ref": "#/definitions/RecognizeOptions", + "description": "Defines options for recognition." + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "RecognizeOptions": { + "required": [ + "targetParticipant" + ], + "type": "object", + "properties": { + "interruptPrompt": { + "description": "Determines if we interrupt the prompt and start recognizing.", + "type": "boolean" + }, + "initialSilenceTimeoutInSeconds": { + "format": "int32", + "description": "Time to wait for first input after prompt (if any).", + "maximum": 300, + "minimum": 0, + "type": "integer" + }, + "targetParticipant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Target participant of DTMF tone recognition." + }, + "speechLanguage": { + "description": "Speech language to be recognized, If not set default is en-US", + "type": "string" + }, + "speechRecognitionModelEndpointId": { + "description": "Endpoint where the custom model was deployed.", + "type": "string" + }, + "dtmfOptions": { + "$ref": "#/definitions/DtmfOptions", + "description": "Defines configurations for DTMF." + }, + "choices": { + "description": "Defines Ivr choices for recognize.", + "type": "array", + "items": { + "$ref": "#/definitions/Choice" + } + }, + "speechOptions": { + "$ref": "#/definitions/SpeechOptions", + "description": "Defines continuous speech recognition option." + } + } + }, + "Tone": { + "enum": [ + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "a", + "b", + "c", + "d", + "pound", + "asterisk" + ], + "type": "string", + "x-ms-enum": { + "name": "Tone", + "modelAsString": true + } + }, + "DtmfOptions": { + "description": "Options for DTMF recognition", + "type": "object", + "properties": { + "interToneTimeoutInSeconds": { + "format": "int32", + "description": "Time to wait between DTMF inputs to stop recognizing.", + "maximum": 60, + "minimum": 1, + "type": "integer" + }, + "maxTonesToCollect": { + "format": "int32", + "description": "Maximum number of DTMF tones to be collected.", + "type": "integer" + }, + "stopTones": { + "description": "List of tones that will stop recognizing.", + "type": "array", + "items": { + "$ref": "#/definitions/Tone" + } + } + } + }, + "Choice": { + "required": [ + "label", + "phrases" + ], + "type": "object", + "properties": { + "label": { + "description": "Identifier for a given choice", + "type": "string" + }, + "phrases": { + "description": "List of phrases to recognize", + "type": "array", + "items": { + "type": "string" + } + }, + "tone": { + "$ref": "#/definitions/Tone" + } + } + }, + "SpeechOptions": { + "description": "Options for continuous speech recognition", + "type": "object", + "properties": { + "endSilenceTimeoutInMs": { + "format": "int64", + "description": "The length of end silence when user stops speaking and cogservice send response.", + "type": "integer" + } + } + }, + "ContinuousDtmfRecognitionRequest": { + "required": [ + "targetParticipant" + ], + "type": "object", + "properties": { + "targetParticipant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Defines options for recognition." + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "SendDtmfRequest": { + "required": [ + "tones", + "targetParticipant" + ], + "type": "object", + "properties": { + "tones": { + "description": "List of tones to be sent to target participant.", + "type": "array", + "items": { + "$ref": "#/definitions/Tone" + } + }, + "targetParticipant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Target participant of send DTMF." + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "HoldParticipantRequest": { + "description": "The request payload for holding participant from the call.", + "required": [ + "participantToHold", + "playSourceInfo" + ], + "type": "object", + "properties": { + "participantToHold": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant to be held from the call." + }, + "playSourceInfo": { + "$ref": "#/definitions/PlaySource", + "description": "Prompt to play while in hold." + }, + "loop": { + "description": "If the prompt will be looped or not.", + "type": "boolean" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "UnholdParticipantRequest": { + "description": "The request payload for holding participant from the call.", + "required": [ + "participantToUnhold" + ], + "type": "object", + "properties": { + "participantToUnhold": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participants to be hold from the call.\r\nOnly ACS Users are supported." + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "DialogInputType": { + "description": "Determines the type of the dialog.", + "enum": [ + "powerVirtualAgents" + ], + "type": "string", + "x-ms-enum": { + "name": "DialogInputType", + "modelAsString": true + } + }, + "StartDialogRequest": { + "required": [ + "dialogOptions", + "dialogInputType" + ], + "type": "object", + "properties": { + "dialogOptions": { + "$ref": "#/definitions/DialogOptions", + "description": "Defines options for dialog." + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + } + } + }, + "DialogOptions": { + "required": [ + "botAppId", + "dialogContext" + ], + "type": "object", + "properties": { + "botAppId": { + "description": "Bot identifier.", + "type": "string" + }, + "dialogContext": { + "description": "Dialog context.", + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "DialogStateResponse": { + "type": "object", + "properties": { + "dialogId": { + "description": "The dialog ID.", + "type": "string" + }, + "dialogOptions": { + "$ref": "#/definitions/DialogOptions", + "description": "Defines options for dialog." + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "operationContext": { + "description": "The value to identify context of the operation.", + "type": "string" + } + } + }, + "GetParticipantsResponse": { + "description": "The response payload for getting participants of the call.", + "type": "object", + "properties": { + "values": { + "description": "List of the current participants in the call.", + "type": "array", + "items": { + "$ref": "#/definitions/CallParticipant" + } + }, + "nextLink": { + "description": "Continue of the list of participants", + "type": "string" + } + } + }, + "CallParticipant": { + "description": "Contract model of an ACS call participant", + "type": "object", + "properties": { + "identifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Communication identifier of the participant" + }, + "isMuted": { + "description": "Is participant muted", + "type": "boolean" + } + } + }, + "AddParticipantRequest": { + "description": "The request payload for adding participant to the call.", + "required": [ + "participantToAdd" + ], + "type": "object", + "properties": { + "sourceCallerIdNumber": { + "$ref": "#/definitions/PhoneNumberIdentifierModel", + "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when inviting a PSTN participant." + }, + "sourceDisplayName": { + "description": "(Optional) The display name of the source that is associated with this invite operation when\r\nadding a PSTN participant or teams user. Note: Will not update the display name in the roster.", + "type": "string" + }, + "participantToAdd": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The participant to invite." + }, + "invitationTimeoutInSeconds": { + "format": "int32", + "description": "Gets or sets the timeout to wait for the invited participant to pickup.\r\nThe maximum value of this is 180 seconds", + "maximum": 180, + "minimum": 0, + "type": "integer" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "customContext": { + "$ref": "#/definitions/CustomContext", + "description": "Used by customer to send custom context to targets" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "AddParticipantResponse": { + "description": "The response payload for adding participants to the call.", + "type": "object", + "properties": { + "participant": { + "$ref": "#/definitions/CallParticipant", + "description": "List of current participants in the call." + }, + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + }, + "invitiationId": { + "description": "Invitation ID used to add a participant.", + "type": "string" + } + } + }, + "RemoveParticipantRequest": { + "description": "The remove participant by identifier request.", + "required": [ + "participantToRemove" + ], + "type": "object", + "properties": { + "participantToRemove": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The participants to be removed from the call." + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "RemoveParticipantResponse": { + "description": "The response payload for removing participants of the call.", + "type": "object", + "properties": { + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + } + } + }, + "MuteParticipantsRequest": { + "description": "The request payload for muting participants from the call.", + "required": [ + "targetParticipants" + ], + "type": "object", + "properties": { + "targetParticipants": { + "description": "Participants to be muted from the call.\r\nOnly ACS Users are supported.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "MuteParticipantsResponse": { + "description": "The response payload for muting participants from the call.", + "type": "object", + "properties": { + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + } + } + }, + "UnmuteParticipantsRequest": { + "description": "The request payload for unmuting participant from the call.", + "required": [ + "targetParticipants" + ], + "type": "object", + "properties": { + "targetParticipants": { + "description": "Participants to be unmuted from the call.\r\nOnly ACS Users are supported.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "UnmuteParticipantsResponse": { + "description": "The response payload for unmuting participants from the call.", + "type": "object", + "properties": { + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + } + } + }, + "CancelAddParticipantRequest": { + "required": [ + "invitiationId" + ], + "type": "object", + "properties": { + "invitiationId": { + "description": "Invitation ID used to add a participant.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "callbackUri": { + "description": "The callback URI to override the main callback URI.", + "type": "string" + } + } + }, + "CancelAddParticipantResponse": { + "type": "object", + "properties": { + "invitationId": { + "description": "Invitation ID used to cancel the add participant action.", + "type": "string" + }, + "operationContext": { + "description": "The operation context provided by client.", + "type": "string" + } + } + }, + "RecordingContentType": { + "description": "The content type of call recording.", + "enum": [ + "audio", + "audioVideo" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingContentType", + "modelAsString": true + } + }, + "RecordingChannelType": { + "description": "The channel type of call recording.", + "enum": [ + "mixed", + "unmixed" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingChannelType", + "modelAsString": true + } + }, + "RecordingFormatType": { + "description": "The format type of call recording.", + "enum": [ + "wav", + "mp3", + "mp4" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingFormatType", + "modelAsString": true + } + }, + "StartCallRecordingRequest": { + "description": "The request payload start for call recording operation with call locator.", + "required": [ + "callLocator" + ], + "type": "object", + "properties": { + "callLocator": { + "$ref": "#/definitions/CallLocator", + "description": "The call locator." + }, + "recordingStateCallbackUri": { + "description": "The uri to send notifications to.", + "type": "string" + }, + "recordingContentType": { + "$ref": "#/definitions/RecordingContentType" + }, + "recordingChannelType": { + "$ref": "#/definitions/RecordingChannelType" + }, + "recordingFormatType": { + "$ref": "#/definitions/RecordingFormatType" + }, + "audioChannelParticipantOrdering": { + "description": "The sequential order in which audio channels are assigned to participants in the unmixed recording.\r\nWhen 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified,\r\nthe audio channel to participant mapping will be automatically assigned based on the order in which participant\r\nfirst audio was detected. Channel to participant mapping details can be found in the metadata of the recording.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + }, + "channelAffinity": { + "description": "The channel affinity of call recording\r\nWhen 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned.\r\nChannel-Participant mapping details can be found in the metadata of the recording.\r\n///", + "type": "array", + "items": { + "$ref": "#/definitions/ChannelAffinity" + } + }, + "externalStorage": { + "$ref": "#/definitions/ExternalStorage", + "description": "Optional property to specify location where recording will be stored" + } + } + }, + "CallLocatorKind": { + "description": "The call locator kind.", + "enum": [ + "groupCallLocator", + "serverCallLocator" + ], + "type": "string", + "x-ms-enum": { + "name": "CallLocatorKind", + "modelAsString": true + } + }, + "CallLocator": { + "description": "The locator used for joining or taking action on a call.", + "type": "object", + "properties": { + "groupCallId": { + "description": "The group call id", + "type": "string" + }, + "serverCallId": { + "description": "The server call id.", + "type": "string" + }, + "kind": { + "$ref": "#/definitions/CallLocatorKind" + } + } + }, + "ChannelAffinity": { + "description": "Channel affinity for a participant", + "required": [ + "participant" + ], + "type": "object", + "properties": { + "channel": { + "format": "int32", + "description": "Channel number to which bitstream from a particular participant will be written.", + "maximum": 4, + "minimum": 0, + "type": "integer" + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The identifier for the participant whose bitstream will be written to the channel \r\nrepresented by the channel number." + } + } + }, + "RecordingStorageType": { + "description": "Defines the type of external storage", + "enum": [ + "acs", + "blobStorage" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingStorageType", + "modelAsString": true + } + }, + "ExternalStorage": { + "required": [ + "storageType" + ], + "type": "object", + "properties": { + "storageType": { + "$ref": "#/definitions/RecordingStorageType" + }, + "blobStorage": { + "$ref": "#/definitions/BlobStorage", + "description": "Defines the blob storage location where the recording will be stored" + } + } + }, + "BlobStorage": { + "description": "Used to specify Blob container url to recording storage", + "required": [ + "containerUri" + ], + "type": "object", + "properties": { + "containerUri": { + "description": "Url of a container or a location within a container", + "type": "string" + } + } + }, + "RecordingState": { + "enum": [ + "active", + "inactive" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingState", + "modelAsString": true + } + }, + "RecordingType": { + "enum": [ + "acs", + "teams" + ], + "type": "string", + "x-ms-enum": { + "name": "RecordingType", + "modelAsString": true + } + }, + "RecordingStateResponse": { + "type": "object", + "properties": { + "recordingId": { + "type": "string" + }, + "recordingState": { + "$ref": "#/definitions/RecordingState" + }, + "recordingType": { + "$ref": "#/definitions/RecordingType" + } + } + }, + "AddParticipantFailed": { + "description": "The failed to add participant event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant" + } + } + }, + "ResultInformation": { + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "Code of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected.", + "type": "integer" + }, + "subCode": { + "format": "int32", + "description": "Subcode of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected.", + "type": "integer" + }, + "message": { + "description": "Detail message that describes the current result.", + "type": "string" + } + } + }, + "AddParticipantSucceeded": { + "description": "The participant successfully added event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant" + } + } + }, + "CallConnected": { + "description": "The call connected event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers to set the context for creating a new call. This property will be null for answering a call.", + "type": "string" + } + } + }, + "CallDisconnected": { + "description": "The call disconnected event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers to set the context for creating a new call. This property will be null for answering a call.", + "type": "string" + } + } + }, + "CallTransferAccepted": { + "description": "The call transfer accepted event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "transferTarget": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Traffer target: the user that transferee will be transferred to", + "readOnly": true + }, + "transferee": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Transferee: the participant being transferred away", + "readOnly": true + } + } + }, + "CallTransferFailed": { + "description": "The call transfer failed event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + } + } + }, + "ParticipantsUpdated": { + "description": "The participants updated in a call event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "sequenceNumber": { + "format": "int32", + "description": "The Sequence Number of the event", + "type": "integer" + }, + "participants": { + "description": "The list of participants in the call.", + "type": "array", + "items": { + "$ref": "#/definitions/CallParticipant" + } + } + } + }, + "RemoveParticipantSucceeded": { + "description": "The participant removed event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant" + } + } + }, + "RemoveParticipantFailed": { + "description": "The failed to remove participant event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant" + } + } + }, + "AddParticipantCancelled": { + "description": "Successful cancel add participant event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "participant": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "Participant that has been cancelled." + }, + "invitiationId": { + "description": "Invitation ID used to cancel the request.", + "type": "string" + } + } + }, + "CancelAddParticipantFailed": { + "description": "Failed cancel add participant event.", + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services." + }, + "invitiationId": { + "description": "Invitation ID used to cancel the request.", + "type": "string" + } + } + }, + "RecordingStateChanged": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "recordingId": { + "description": "The call recording id", + "type": "string", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/RecordingState" + }, + "startDateTime": { + "format": "date-time", + "description": "The time of the recording started", + "type": "string", + "readOnly": true + } + } + }, + "PlayCompleted": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + }, + "PlayFailed": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + }, + "PlayCanceled": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "RecognitionType": { + "description": "Determines the sub-type of the recognize operation.\r\nIn case of cancel operation the this field is not set and is returned empty", + "enum": [ + "dtmf", + "speech", + "choices" + ], + "type": "string", + "x-ms-enum": { + "name": "RecognitionType", + "modelAsString": true + } + }, + "RecognizeCompleted": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + }, + "recognitionType": { + "$ref": "#/definitions/RecognitionType" + }, + "collectTonesResult": { + "$ref": "#/definitions/CollectTonesResult", + "description": "Defines the result for RecognitionType = Dtmf\r\nWould be replaced by DtmfResult after server sdk renewed" + }, + "dtmfResult": { + "$ref": "#/definitions/DtmfResult", + "description": "Defines the result for RecognitionType = Dtmf" + }, + "choiceResult": { + "$ref": "#/definitions/ChoiceResult", + "description": "Defines the result for RecognitionType = Choices" + }, + "speechResult": { + "$ref": "#/definitions/SpeechResult", + "description": "Defines the result for RecognitionType = Speech and SpeechOrDtmf", + "readOnly": true + } + } + }, + "CollectTonesResult": { + "type": "object", + "properties": { + "tones": { + "type": "array", + "items": { + "$ref": "#/definitions/Tone" + }, + "readOnly": true + } + } + }, + "DtmfResult": { + "type": "object", + "properties": { + "tones": { + "type": "array", + "items": { + "$ref": "#/definitions/Tone" + }, + "readOnly": true + } + } + }, + "ChoiceResult": { + "type": "object", + "properties": { + "label": { + "description": "Label is the primary identifier for the choice detected", + "type": "string" + }, + "recognizedPhrase": { + "description": "Phrases are set to the value if choice is selected via phrase detection.\r\nIf Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to null", + "type": "string" + } + } + }, + "SpeechResult": { + "description": "The speech status as a result.", + "type": "object", + "properties": { + "speech": { + "description": "The recognized speech in string.", + "type": "string" + } + } + }, + "RecognizeFailed": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + }, + "RecognizeCanceled": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "DialogCompleted": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + } + } + }, + "DialogFailed": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + } + } + }, + "DialogConsent": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "userConsent": { + "$ref": "#/definitions/UserConsent", + "description": "UserConsent data from the Conversation Conductor", + "readOnly": true + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + } + } + }, + "UserConsent": { + "type": "object", + "properties": { + "recording": { + "format": "int32", + "type": "integer" + } + } + }, + "DialogStarted": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + } + } + }, + "DialogHangup": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + }, + "ivrContext": { + "description": "Ivr Context", + "type": "object", + "readOnly": true + } + } + }, + "DialogTransfer": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + }, + "transferType": { + "description": "Transfer type", + "type": "string", + "readOnly": true + }, + "transferDestination": { + "description": "Transfer destination", + "type": "string", + "readOnly": true + }, + "ivrContext": { + "description": "IVR context", + "type": "object", + "readOnly": true + } + } + }, + "DialogLanguageChange": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + }, + "selectedLanguage": { + "description": "Selected Language", + "type": "string", + "readOnly": true + }, + "ivrContext": { + "description": "Ivr Context", + "type": "object", + "readOnly": true + } + } + }, + "DialogSensitivityUpdate": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string", + "readOnly": true + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling answerCall action to correlate the request to the response event.", + "type": "string", + "readOnly": true + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code/sub-code and message from NGC services.", + "readOnly": true + }, + "dialogInputType": { + "$ref": "#/definitions/DialogInputType" + }, + "dialogId": { + "description": "Dialog ID", + "type": "string", + "readOnly": true + }, + "sensitiveMask": { + "description": "SensitiveMask", + "type": "boolean", + "readOnly": true + } + } + }, + "ContinuousDtmfRecognitionToneFailed": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "ContinuousDtmfRecognitionToneReceived": { + "type": "object", + "properties": { + "toneInfo": { + "$ref": "#/definitions/ToneInfo", + "description": "Information about Tone." + }, + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation. Also called ChainId or skype chain ID.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + } + } + }, + "ToneInfo": { + "description": "The information about the tone.", + "required": [ + "sequenceId", + "tone" + ], + "type": "object", + "properties": { + "sequenceId": { + "format": "int32", + "description": "The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed.", + "type": "integer" + }, + "tone": { + "$ref": "#/definitions/Tone" + } + } + }, + "ContinuousDtmfRecognitionStopped": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + }, + "SendDtmfCompleted": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + }, + "SendDtmfFailed": { + "type": "object", + "properties": { + "callConnectionId": { + "description": "Call connection ID.", + "type": "string" + }, + "serverCallId": { + "description": "Server call ID.", + "type": "string" + }, + "correlationId": { + "description": "Correlation ID for event to call correlation.", + "type": "string" + }, + "operationContext": { + "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", + "type": "string" + }, + "resultInformation": { + "$ref": "#/definitions/ResultInformation", + "description": "Contains the resulting SIP code, sub-code and message." + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "Version of API to invoke.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Endpoint": { + "name": "endpoint", + "in": "path", + "description": "The endpoint of the Azure Communication resource.", + "required": true, + "type": "string", + "format": "url", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + }, + "securityDefinitions": { + "Authorization": { + "type": "apiKey", + "description": "An Azure Communication Services user access token.", + "name": "Authorization", + "in": "header" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} From 79fc29842e6ef6f8b023dc4f6668ff7055cd2c86 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Wed, 20 Sep 2023 11:34:14 -0700 Subject: [PATCH 02/10] Updating swagger --- .../src/Generated/CallConnectionRestClient.cs | 96 - .../src/Generated/CallMediaRestClient.cs | 234 +- ...CommunicationCallAutomationModelFactory.cs | 9 - .../Models/AddParticipantCancelled.cs | 33 - .../Models/CancelAddParticipantRequest.cs | 33 - ...celAddParticipantResponse.Serialization.cs | 39 - .../Models/CancelAddParticipantResponse.cs | 32 - .../src/Generated/Models/DialogInputType.cs | 3 + .../DialogOptionsInternal.Serialization.cs | 11 +- .../Generated/Models/DialogOptionsInternal.cs | 14 +- ...tartTranscriptionRequest.Serialization.cs} | 14 +- .../Models/StartTranscriptionRequest.cs | 23 + .../StopTranscriptionRequest.Serialization.cs | 26 + .../Models/StopTranscriptionRequest.cs | 21 + ...cipantFailed.cs => TranscriptionFailed.cs} | 14 +- .../Generated/Models/TranscriptionResumed.cs | 31 + .../Generated/Models/TranscriptionStarted.cs | 31 + .../Generated/Models/TranscriptionStopped.cs | 31 + .../Generated/Models/TranscriptionUpdate.cs | 23 + ...eTranscriptionDataRequest.Serialization.cs | 23 + .../Models/UpdateTranscriptionDataRequest.cs | 29 + .../CancelAddParticipantRequestInternal.cs | 5 - .../Models/HoldParticipantRequestInternal.cs | 5 - .../src/autorest.md | 4 +- .../src/swagger/common.json | 172 - .../src/swagger/swagger.json | 3918 ----------------- 26 files changed, 503 insertions(+), 4371 deletions(-) delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs rename sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/{CancelAddParticipantRequest.Serialization.cs => StartTranscriptionRequest.Serialization.cs} (64%) create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.cs rename sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/{CancelAddParticipantFailed.cs => TranscriptionFailed.cs} (58%) create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResumed.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdate.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs index 5535324fc96c..abbaf4191c22 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs @@ -814,102 +814,6 @@ public Response CancelAddParticipant(strin } } - internal HttpMessage CreateCancelAddParticipantRequest(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID, DateTimeOffset? repeatabilityFirstSent) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/calling/callConnections/", false); - uri.AppendPath(callConnectionId, true); - uri.AppendPath("/participants:cancelAddParticipant", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - if (repeatabilityRequestID != null) - { - request.Headers.Add("Repeatability-Request-ID", repeatabilityRequestID.Value); - } - if (repeatabilityFirstSent != null) - { - request.Headers.Add("Repeatability-First-Sent", repeatabilityFirstSent.Value, "R"); - } - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(cancelAddParticipantRequest); - request.Content = content; - return message; - } - - /// Cancel add participant operation. - /// The call connection Id. - /// Cancellation request. - /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID. - /// If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - /// The cancellation token to use. - /// or is null. - public async Task> CancelAddParticipantAsync(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) - { - if (callConnectionId == null) - { - throw new ArgumentNullException(nameof(callConnectionId)); - } - if (cancelAddParticipantRequest == null) - { - throw new ArgumentNullException(nameof(cancelAddParticipantRequest)); - } - - using var message = CreateCancelAddParticipantRequest(callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - { - CancelAddParticipantResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CancelAddParticipantResponse.DeserializeCancelAddParticipantResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancel add participant operation. - /// The call connection Id. - /// Cancellation request. - /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID. - /// If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - /// The cancellation token to use. - /// or is null. - public Response CancelAddParticipant(string callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Guid? repeatabilityRequestID = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) - { - if (callConnectionId == null) - { - throw new ArgumentNullException(nameof(callConnectionId)); - } - if (cancelAddParticipantRequest == null) - { - throw new ArgumentNullException(nameof(cancelAddParticipantRequest)); - } - - using var message = CreateCancelAddParticipantRequest(callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - { - CancelAddParticipantResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CancelAddParticipantResponse.DeserializeCancelAddParticipantResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal HttpMessage CreateGetParticipantRequest(string callConnectionId, string participantRawId) { var message = _pipeline.CreateMessage(); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs index 3a69b4303c30..30611d80f428 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs @@ -111,6 +111,156 @@ public Response Play(string callConnectionId, PlayRequestInternal playRequest, C } } + internal HttpMessage CreateStartTranscriptionRequest(string callConnectionId, StartTranscriptionRequest startTranscriptionRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath(":StartTranscription", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(startTranscriptionRequest); + request.Content = content; + return message; + } + + /// Starts transcripition in the call. + /// The call connection id. + /// The StartTranscriptionRequest to use. + /// The cancellation token to use. + /// or is null. + /// Starts transcription in the call. + public async Task StartTranscriptionAsync(string callConnectionId, StartTranscriptionRequest startTranscriptionRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (startTranscriptionRequest == null) + { + throw new ArgumentNullException(nameof(startTranscriptionRequest)); + } + + using var message = CreateStartTranscriptionRequest(callConnectionId, startTranscriptionRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts transcripition in the call. + /// The call connection id. + /// The StartTranscriptionRequest to use. + /// The cancellation token to use. + /// or is null. + /// Starts transcription in the call. + public Response StartTranscription(string callConnectionId, StartTranscriptionRequest startTranscriptionRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (startTranscriptionRequest == null) + { + throw new ArgumentNullException(nameof(startTranscriptionRequest)); + } + + using var message = CreateStartTranscriptionRequest(callConnectionId, startTranscriptionRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopTranscriptionRequest(string callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath(":StopTranscripition", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(stopTranscriptionRequest); + request.Content = content; + return message; + } + + /// Stops transcription in the call. + /// The call connection id. + /// stop transcription request payload. + /// The cancellation token to use. + /// or is null. + public async Task StopTranscriptionAsync(string callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (stopTranscriptionRequest == null) + { + throw new ArgumentNullException(nameof(stopTranscriptionRequest)); + } + + using var message = CreateStopTranscriptionRequest(callConnectionId, stopTranscriptionRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops transcription in the call. + /// The call connection id. + /// stop transcription request payload. + /// The cancellation token to use. + /// or is null. + public Response StopTranscription(string callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (stopTranscriptionRequest == null) + { + throw new ArgumentNullException(nameof(stopTranscriptionRequest)); + } + + using var message = CreateStopTranscriptionRequest(callConnectionId, stopTranscriptionRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateCancelAllMediaOperationsRequest(string callConnectionId) { var message = _pipeline.CreateMessage(); @@ -467,6 +617,82 @@ public Response SendDtmf(string callConnectionId, SendDtmfRequestInternal sendDt } } + internal HttpMessage CreateUpdateTranscriptionDataRequest(string callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections/", false); + uri.AppendPath(callConnectionId, true); + uri.AppendPath(":updateTranscriptionData", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(updateTranscriptionDataRequest); + request.Content = content; + return message; + } + + /// UpdateTranscriptionData Api. + /// The call connection id. + /// The updateTranscriptionData request. + /// The cancellation token to use. + /// or is null. + /// API to change transcription language. + public async Task UpdateTranscriptionDataAsync(string callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (updateTranscriptionDataRequest == null) + { + throw new ArgumentNullException(nameof(updateTranscriptionDataRequest)); + } + + using var message = CreateUpdateTranscriptionDataRequest(callConnectionId, updateTranscriptionDataRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// UpdateTranscriptionData Api. + /// The call connection id. + /// The updateTranscriptionData request. + /// The cancellation token to use. + /// or is null. + /// API to change transcription language. + public Response UpdateTranscriptionData(string callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest, CancellationToken cancellationToken = default) + { + if (callConnectionId == null) + { + throw new ArgumentNullException(nameof(callConnectionId)); + } + if (updateTranscriptionDataRequest == null) + { + throw new ArgumentNullException(nameof(updateTranscriptionDataRequest)); + } + + using var message = CreateUpdateTranscriptionDataRequest(callConnectionId, updateTranscriptionDataRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest) { var message = _pipeline.CreateMessage(); @@ -487,7 +713,7 @@ internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, HoldPa return message; } - /// Unmute participants from the call using identifier. + /// Hold participant from the call using identifier. /// The call connection id. /// The participants to be hold from the call. /// The cancellation token to use. @@ -514,7 +740,7 @@ public async Task StartHoldMusicAsync(string callConnectionId, HoldPar } } - /// Unmute participants from the call using identifier. + /// Hold participant from the call using identifier. /// The call connection id. /// The participants to be hold from the call. /// The cancellation token to use. @@ -561,7 +787,7 @@ internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, UnholdP return message; } - /// Unmute participants from the call using identifier. + /// Unhold participants from the call using identifier. /// The call connection id. /// The participants to be hold from the call. /// The cancellation token to use. @@ -588,7 +814,7 @@ public async Task StopHoldMusicAsync(string callConnectionId, UnholdPa } } - /// Unmute participants from the call using identifier. + /// Unhold participants from the call using identifier. /// The call connection id. /// The participants to be hold from the call. /// The cancellation token to use. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs index 1844f01cd7cd..5fe9ae11294f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CommunicationCallAutomationModelFactory.cs @@ -38,15 +38,6 @@ public static UnmuteParticipantsResult UnmuteParticipantsResult(string operation return new UnmuteParticipantsResult(operationContext); } - /// Initializes a new instance of CancelAddParticipantResponse. - /// Invitation ID used to cancel the add participant action. - /// The operation context provided by client. - /// A new instance for mocking. - public static CancelAddParticipantResponse CancelAddParticipantResponse(string invitationId = null, string operationContext = null) - { - return new CancelAddParticipantResponse(invitationId, operationContext); - } - /// Initializes a new instance of RecordingStateResult. /// /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs deleted file mode 100644 index 7b924d10c155..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantCancelled.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Communication; - -namespace Azure.Communication.CallAutomation -{ - /// Successful cancel add participant event. - internal partial class AddParticipantCancelled - { - /// Initializes a new instance of AddParticipantCancelled. - internal AddParticipantCancelled() - { - } - - /// Call connection ID. - public string CallConnectionId { get; } - /// Server call ID. - public string ServerCallId { get; } - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - public string CorrelationId { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Participant that has been cancelled. - public CommunicationIdentifierModel Participant { get; } - /// Invitation ID used to cancel the request. - public string InvitiationId { get; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs deleted file mode 100644 index a2621b74ea19..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - /// The CancelAddParticipantRequest. - public partial class CancelAddParticipantRequest - { - /// Initializes a new instance of CancelAddParticipantRequest. - /// Invitation ID used to add a participant. - /// is null. - public CancelAddParticipantRequest(string invitiationId) - { - Argument.AssertNotNull(invitiationId, nameof(invitiationId)); - - InvitiationId = invitiationId; - } - - /// Invitation ID used to add a participant. - public string InvitiationId { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; set; } - /// The callback URI to override the main callback URI. - public string CallbackUri { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs deleted file mode 100644 index 7c08c5b2b7a2..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - public partial class CancelAddParticipantResponse - { - internal static CancelAddParticipantResponse DeserializeCancelAddParticipantResponse(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional invitationId = default; - Optional operationContext = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("invitationId"u8)) - { - invitationId = property.Value.GetString(); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - } - return new CancelAddParticipantResponse(invitationId.Value, operationContext.Value); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs deleted file mode 100644 index fd4aac3e6cb8..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantResponse.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Communication.CallAutomation -{ - /// The CancelAddParticipantResponse. - public partial class CancelAddParticipantResponse - { - /// Initializes a new instance of CancelAddParticipantResponse. - internal CancelAddParticipantResponse() - { - } - - /// Initializes a new instance of CancelAddParticipantResponse. - /// Invitation ID used to cancel the add participant action. - /// The operation context provided by client. - internal CancelAddParticipantResponse(string invitationId, string operationContext) - { - InvitationId = invitationId; - OperationContext = operationContext; - } - - /// Invitation ID used to cancel the add participant action. - public string InvitationId { get; } - /// The operation context provided by client. - public string OperationContext { get; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogInputType.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogInputType.cs index d6e981702996..a05ee979cc16 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogInputType.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogInputType.cs @@ -23,9 +23,12 @@ public DialogInputType(string value) } private const string PowerVirtualAgentsValue = "powerVirtualAgents"; + private const string AzureOpenAIValue = "azureOpenAI"; /// powerVirtualAgents. public static DialogInputType PowerVirtualAgents { get; } = new DialogInputType(PowerVirtualAgentsValue); + /// azureOpenAI. + public static DialogInputType AzureOpenAI { get; } = new DialogInputType(AzureOpenAIValue); /// Determines if two values are the same. public static bool operator ==(DialogInputType left, DialogInputType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.Serialization.cs index 623f68f6f34d..29e69af21a0f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.Serialization.cs @@ -16,8 +16,11 @@ internal partial class DialogOptionsInternal : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("botAppId"u8); - writer.WriteStringValue(BotAppId); + if (Optional.IsDefined(BotAppId)) + { + writer.WritePropertyName("botAppId"u8); + writer.WriteStringValue(BotAppId); + } writer.WritePropertyName("dialogContext"u8); writer.WriteStartObject(); foreach (var item in DialogContext) @@ -40,7 +43,7 @@ internal static DialogOptionsInternal DeserializeDialogOptionsInternal(JsonEleme { return null; } - string botAppId = default; + Optional botAppId = default; IDictionary dialogContext = default; foreach (var property in element.EnumerateObject()) { @@ -67,7 +70,7 @@ internal static DialogOptionsInternal DeserializeDialogOptionsInternal(JsonEleme continue; } } - return new DialogOptionsInternal(botAppId, dialogContext); + return new DialogOptionsInternal(botAppId.Value, dialogContext); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.cs index ace1e2de2f6b..f323508028e3 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogOptionsInternal.cs @@ -15,14 +15,20 @@ namespace Azure.Communication.CallAutomation internal partial class DialogOptionsInternal { /// Initializes a new instance of DialogOptionsInternal. - /// Bot identifier. /// Dialog context. - /// or is null. - public DialogOptionsInternal(string botAppId, IDictionary dialogContext) + /// is null. + public DialogOptionsInternal(IDictionary dialogContext) { - Argument.AssertNotNull(botAppId, nameof(botAppId)); Argument.AssertNotNull(dialogContext, nameof(dialogContext)); + DialogContext = dialogContext; + } + + /// Initializes a new instance of DialogOptionsInternal. + /// Bot identifier. + /// Dialog context. + internal DialogOptionsInternal(string botAppId, IDictionary dialogContext) + { BotAppId = botAppId; DialogContext = dialogContext; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.Serialization.cs similarity index 64% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.Serialization.cs index deab876b531a..59b2f0476102 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantRequest.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.Serialization.cs @@ -10,23 +10,21 @@ namespace Azure.Communication.CallAutomation { - public partial class CancelAddParticipantRequest : IUtf8JsonSerializable + public partial class StartTranscriptionRequest : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("invitiationId"u8); - writer.WriteStringValue(InvitiationId); + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + } if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } - if (Optional.IsDefined(CallbackUri)) - { - writer.WritePropertyName("callbackUri"u8); - writer.WriteStringValue(CallbackUri); - } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.cs new file mode 100644 index 000000000000..7d08c51e2484 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequest.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The StartTranscriptionRequest. + public partial class StartTranscriptionRequest + { + /// Initializes a new instance of StartTranscriptionRequest. + public StartTranscriptionRequest() + { + } + + /// Defines Locale for the transcription e,g en-US. + public string Locale { get; set; } + /// The value to identify context of the operation. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.Serialization.cs new file mode 100644 index 000000000000..fdaebe2606e5 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + public partial class StopTranscriptionRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.cs new file mode 100644 index 000000000000..362026753910 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequest.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The StopTranscriptionRequest. + public partial class StopTranscriptionRequest + { + /// Initializes a new instance of StopTranscriptionRequest. + public StopTranscriptionRequest() + { + } + + /// The value to identify context of the operation. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs similarity index 58% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs index e5d426aa3cc6..1f29ea9a23c5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs @@ -7,11 +7,11 @@ namespace Azure.Communication.CallAutomation { - /// Failed cancel add participant event. - internal partial class CancelAddParticipantFailed + /// The TranscriptionFailed. + internal partial class TranscriptionFailed { - /// Initializes a new instance of CancelAddParticipantFailed. - internal CancelAddParticipantFailed() + /// Initializes a new instance of TranscriptionFailed. + internal TranscriptionFailed() { } @@ -21,11 +21,11 @@ internal CancelAddParticipantFailed() public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Used by customers when calling answerCall action to correlate the request to the response event. public string OperationContext { get; } /// Contains the resulting SIP code/sub-code and message from NGC services. public ResultInformation ResultInformation { get; } - /// Invitation ID used to cancel the request. - public string InvitiationId { get; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. + public TranscriptionUpdate TranscriptionUpdateResult { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResumed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResumed.cs new file mode 100644 index 000000000000..b94d62cc9fd0 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResumed.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionResumed. + internal partial class TranscriptionResumed + { + /// Initializes a new instance of TranscriptionResumed. + internal TranscriptionResumed() + { + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling answerCall action to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code/sub-code and message from NGC services. + public ResultInformation ResultInformation { get; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. + public TranscriptionUpdate TranscriptionUpdateResult { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs new file mode 100644 index 000000000000..c97f91d1530e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionStarted. + internal partial class TranscriptionStarted + { + /// Initializes a new instance of TranscriptionStarted. + internal TranscriptionStarted() + { + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling answerCall action to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code/sub-code and message from NGC services. + public ResultInformation ResultInformation { get; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. + public TranscriptionUpdate TranscriptionUpdateResult { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs new file mode 100644 index 000000000000..82a7cb32cc47 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionStopped. + internal partial class TranscriptionStopped + { + /// Initializes a new instance of TranscriptionStopped. + internal TranscriptionStopped() + { + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling answerCall action to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code/sub-code and message from NGC services. + public ResultInformation ResultInformation { get; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. + public TranscriptionUpdate TranscriptionUpdateResult { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdate.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdate.cs new file mode 100644 index 000000000000..25237c7ab8a3 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdate.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionUpdate. + internal partial class TranscriptionUpdate + { + /// Initializes a new instance of TranscriptionUpdate. + internal TranscriptionUpdate() + { + } + + /// Gets the transcription status. + public string TranscriptionStatus { get; } + /// Gets the transcription status details. + public string TranscriptionStatusDetails { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.Serialization.cs new file mode 100644 index 000000000000..0f76b6afdc77 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + public partial class UpdateTranscriptionDataRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.cs new file mode 100644 index 000000000000..abc8246a960b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionDataRequest.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The UpdateTranscriptionDataRequest. + public partial class UpdateTranscriptionDataRequest + { + /// Initializes a new instance of UpdateTranscriptionDataRequest. + /// Defines new locale for transcription. + /// is null. + public UpdateTranscriptionDataRequest(string locale) + { + Argument.AssertNotNull(locale, nameof(locale)); + + Locale = locale; + } + + /// Defines new locale for transcription. + public string Locale { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs index be422bb19255..397b6d4effd7 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs @@ -5,13 +5,8 @@ namespace Azure.Communication.CallAutomation { -<<<<<<<< HEAD:sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs - [CodeGenModel("HoldParticipantRequest")] - internal partial class HoldParticipantRequestInternal -======== [CodeGenModel("CancelAddParticipantRequest")] internal partial class CancelAddParticipantRequestInternal ->>>>>>>> main:sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs { } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs index be422bb19255..6b9b99779d8f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs @@ -5,13 +5,8 @@ namespace Azure.Communication.CallAutomation { -<<<<<<<< HEAD:sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs [CodeGenModel("HoldParticipantRequest")] internal partial class HoldParticipantRequestInternal -======== - [CodeGenModel("CancelAddParticipantRequest")] - internal partial class CancelAddParticipantRequestInternal ->>>>>>>> main:sdk/communication/Azure.Communication.CallAutomation/src/Models/CancelAddParticipantRequestInternal.cs { } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index e2ce50c383dd..59dccc362352 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -9,8 +9,8 @@ From Folder that contains autorest.md, Run `dotnet msbuild /t:GenerateCode` to g model-namespace: false tag: package-2023-01-15-preview -input-file: - - swagger/swagger.json +require: + - https://github.com/cochi2/azure-rest-api-specs/blob/165e9bcec8bcd7d2085df5fa0cd6a7e8f587caa1/specification/communication/data-plane/CallAutomation/readme.md title: Azure Communication Services diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json deleted file mode 100644 index a5b3fd88c562..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/common.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Communication", - "description": "Communication Services API common types.", - "version": "2022-07-13" - }, - "paths": {}, - "definitions": { - "CommunicationErrorResponse": { - "description": "The Communication Services error.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "description": "The Communication Services error.", - "$ref": "#/definitions/CommunicationError" - } - } - }, - "CommunicationError": { - "description": "The Communication Services error.", - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "The error code." - }, - "message": { - "type": "string", - "description": "The error message." - }, - "target": { - "type": "string", - "readOnly": true, - "description": "The error target." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationError" - }, - "readOnly": true, - "description": "Further details about specific errors that led to this error." - }, - "innererror": { - "x-ms-client-name": "innerError", - "readOnly": true, - "$ref": "#/definitions/CommunicationError", - "description": "The inner error if any." - } - } - }, - "CommunicationCloudEnvironmentModel": { - "description": "The cloud that the identifier belongs to.", - "type": "string", - "enum": [ - "public", - "dod", - "gcch" - ], - "x-ms-enum": { - "name": "CommunicationCloudEnvironmentModel", - "modelAsString": true - } - }, - "CommunicationIdentifierModelKind": { - "description": "The identifier kind, for example 'communicationUser' or 'phoneNumber'.", - "type": "string", - "enum": [ - "unknown", - "communicationUser", - "phoneNumber", - "microsoftTeamsUser" - ], - "x-ms-enum": { - "name": "CommunicationIdentifierModelKind", - "modelAsString": true - } - }, - "CommunicationIdentifierModel": { - "description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model is polymorphic: Apart from kind and rawId, at most one further property may be set which must match the kind enum value.", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/CommunicationIdentifierModelKind", - "description": "The identifier kind. Only required in responses." - }, - "rawId": { - "type": "string", - "description": "Raw Id of the identifier. Optional in requests, required in responses." - }, - "communicationUser": { - "$ref": "#/definitions/CommunicationUserIdentifierModel", - "description": "The communication user." - }, - "phoneNumber": { - "$ref": "#/definitions/PhoneNumberIdentifierModel", - "description": "The phone number." - }, - "microsoftTeamsUser": { - "$ref": "#/definitions/MicrosoftTeamsUserIdentifierModel", - "description": "The Microsoft Teams user." - } - } - }, - "CommunicationUserIdentifierModel": { - "description": "A user that got created with an Azure Communication Services resource.", - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "The Id of the communication user." - } - } - }, - "PhoneNumberIdentifierModel": { - "description": "A phone number.", - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "The phone number in E.164 format." - } - } - }, - "MicrosoftTeamsUserIdentifierModel": { - "description": "A Microsoft Teams user.", - "type": "object", - "required": [ - "userId" - ], - "properties": { - "userId": { - "type": "string", - "description": "The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user." - }, - "isAnonymous": { - "type": "boolean", - "description": "True if the Microsoft Teams user is anonymous. By default false if missing." - }, - "cloud": { - "$ref": "#/definitions/CommunicationCloudEnvironmentModel", - "description": "The cloud that the Microsoft Teams user belongs to. By default 'public' if missing." - } - } - } - }, - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json b/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json deleted file mode 100644 index 6d2f878722f0..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/swagger/swagger.json +++ /dev/null @@ -1,3918 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2023-01-15-preview", - "title": "Azure Communication Service Call Automation APIs", - "description": "Azure Communication Service Call Automation APIs" - }, - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/calling/callConnections": { - "post": { - "tags": [ - "PreConnections" - ], - "summary": "Create an outbound call.", - "description": "Create an outbound call.", - "operationId": "CreateCall", - "parameters": [ - { - "name": "createCallRequest", - "in": "body", - "description": "The create call request.", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCallRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "201": { - "description": "Returns details of the call properties once the CreateCall request is received by service. You will receive CallConnected event at your specified callback URI, once the call is connected.", - "schema": { - "$ref": "#/definitions/CallConnectionProperties" - } - } - }, - "x-ms-examples": { - "CreateCall": { - "$ref": "./examples/CreateCall.json" - } - } - } - }, - "/calling/callConnections:answer": { - "post": { - "tags": [ - "PreConnections" - ], - "summary": "Answer a Call.", - "description": "Answer a call using the IncomingCallContext from Event Grid.", - "operationId": "AnswerCall", - "parameters": [ - { - "name": "answerCallRequest", - "in": "body", - "description": "The answer call request.", - "required": true, - "schema": { - "$ref": "#/definitions/AnswerCallRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns details of the call properties once the AnswerCall request is received by service. You will receive CallConnected event at your specified callback URI, once the call is connected.", - "schema": { - "$ref": "#/definitions/CallConnectionProperties" - } - } - }, - "x-ms-examples": { - "AnswerCall": { - "$ref": "./examples/AnswerCall.json" - } - } - } - }, - "/calling/callConnections:redirect": { - "post": { - "tags": [ - "PreConnections" - ], - "summary": "Redirect a call.", - "description": "Redirect a call.", - "operationId": "RedirectCall", - "parameters": [ - { - "name": "redirectCallRequest", - "in": "body", - "description": "The redirect call request.", - "required": true, - "schema": { - "$ref": "#/definitions/RedirectCallRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "The service has redirected the call to specified endpoint." - } - }, - "x-ms-examples": { - "RedirectCall": { - "$ref": "./examples/RedirectCall.json" - } - } - } - }, - "/calling/callConnections:reject": { - "post": { - "tags": [ - "PreConnections" - ], - "summary": "Reject the call.", - "description": "Reject the call.", - "operationId": "RejectCall", - "parameters": [ - { - "name": "rejectCallRequest", - "in": "body", - "description": "The reject call request.", - "required": true, - "schema": { - "$ref": "#/definitions/RejectCallRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "The service has rejected the call." - } - }, - "x-ms-examples": { - "RejectCall": { - "$ref": "./examples/RejectCall.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}": { - "get": { - "tags": [ - "MidConnections" - ], - "summary": "Get call connection.", - "operationId": "CallConnection_GetCall", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns details of the call properties.", - "schema": { - "$ref": "#/definitions/CallConnectionProperties" - } - } - }, - "x-ms-examples": { - "CallConnection_GetCall": { - "$ref": "./examples/CallConnection_GetCall.json" - } - } - }, - "delete": { - "tags": [ - "MidConnections" - ], - "summary": "Hangup the call.", - "description": "Hangup the call.", - "operationId": "CallConnection_HangupCall", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "Call automation service has left the call." - } - }, - "x-ms-examples": { - "CallConnection_HangupCall": { - "$ref": "./examples/CallConnection_HangupCall.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:terminate": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Terminate a call using CallConnectionId.", - "description": "Terminate a call using CallConnectionId.", - "operationId": "CallConnection_TerminateCall", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The terminate call request.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "The call is terminated." - } - }, - "x-ms-examples": { - "CallConnection_TerminateCall": { - "$ref": "./examples/CallConnection_TerminateCall.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:transferToParticipant": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Transfer the call to a participant.", - "description": "Transfer the call to a participant.", - "operationId": "CallConnection_TransferToParticipant", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "transferToParticipantRequest", - "in": "body", - "description": "The transfer to participant request.", - "required": true, - "schema": { - "$ref": "#/definitions/TransferToParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the transfer request and will begin processing it. You will receive either CallTransferAccepted or CallTransferFailed event at your specified callback URI to update you on the status of the request.", - "schema": { - "$ref": "#/definitions/TransferCallResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_TransferToParticipant": { - "$ref": "./examples/CallConnection_TransferToParticipant.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:play": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Plays audio to participants in the call.", - "description": "Plays audio to participants in the call.", - "operationId": "CallMedia_Play", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "playRequest", - "in": "body", - "description": "play request payload.", - "required": true, - "schema": { - "$ref": "#/definitions/PlayRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the play request and will begin processing it. You will receive either PlayCompleted or PlayFailed event at your specified callback URI to update you on the status of the request." - } - }, - "x-ms-examples": { - "CallMedia_Play": { - "$ref": "./examples/CallMedia_Play.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:cancelAllMediaOperations": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Cancel all media operations in a call.", - "description": "Cancel all media operations in a call.", - "operationId": "CallMedia_CancelAllMediaOperations", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the cancel request and will begin processing it. RecognizeCanceled and/or PlayCanceled at your specified callback URI to update you on the status of the request, based on which media operation has been canceled by it." - } - }, - "x-ms-examples": { - "CallMedia_CancelAllMediaOperations": { - "$ref": "./examples/CallMedia_CancelAllMediaOperations.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:recognize": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Recognize media from call.", - "description": "Recognize media from call.", - "operationId": "CallMedia_Recognize", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "recognizeRequest", - "in": "body", - "description": "The media recognize request", - "required": true, - "schema": { - "$ref": "#/definitions/RecognizeRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the recognize request and will begin processing it. You will receive either RecognizeCompleted or RecognizeFailed event at your specified callback URI to update you on the status of the request." - } - }, - "x-ms-examples": { - "CallMedia_Recognize": { - "$ref": "./examples/CallMedia_Recognize.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:startContinuousDtmfRecognition": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Start continuous Dtmf recognition by subscribing to tones.", - "operationId": "CallMedia_StartContinuousDtmfRecognition", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "continuousDtmfRecognitionRequest", - "in": "body", - "description": "The continuous recognize request", - "required": true, - "schema": { - "$ref": "#/definitions/ContinuousDtmfRecognitionRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "The service has accepted the start continuous recognize request and will begin processing it. You will receive events at your specified callback URI to update you on the status of the request." - } - }, - "x-ms-examples": { - "CallMedia_StartContinuousDtmfRecognition": { - "$ref": "./examples/CallMedia_StartContinuousDtmfRecognition.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:stopContinuousDtmfRecognition": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Stop continuous Dtmf recognition by unsubscribing to tones.", - "operationId": "CallMedia_StopContinuousDtmfRecognition", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "continuousDtmfRecognitionRequest", - "in": "body", - "description": "The continuous recognize request", - "required": true, - "schema": { - "$ref": "#/definitions/ContinuousDtmfRecognitionRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "The service has accepted the stop continuous recognize request and will begin processing it. You will receive events at your specified callback URI to update you on the status of the request." - } - }, - "x-ms-examples": { - "CallMedia_StopContinuousDtmfRecognition": { - "$ref": "./examples/CallMedia_StopContinuousDtmfRecognition.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:sendDtmf": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Send dtmf tones.", - "description": "Send dtmf tones.", - "operationId": "CallMedia_SendDtmf", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "sendDtmfRequest", - "in": "body", - "description": "The send dtmf request", - "required": true, - "schema": { - "$ref": "#/definitions/SendDtmfRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "Returns the send dtmf response" - } - }, - "x-ms-examples": { - "CallMedia_SendDtmf": { - "$ref": "./examples/CallMedia_SendDtmf.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:startHoldMusic": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Unmute participants from the call using identifier.", - "description": "Unmute participants from the call using identifier.", - "operationId": "CallMedia_StartHoldMusic", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "holdParticipantRequest", - "in": "body", - "description": "The participants to be hold from the call.", - "required": true, - "schema": { - "$ref": "#/definitions/HoldParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the hold participant response" - } - }, - "x-ms-examples": { - "CallMedia_StartHoldMusic": { - "$ref": "./examples/CallMedia_StartHoldMusic.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}:stopHoldMusic": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Unmute participants from the call using identifier.", - "description": "Unmute participants from the call using identifier.", - "operationId": "CallMedia_StopHoldMusic", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "unholdParticipantRequest", - "in": "body", - "description": "The participants to be hold from the call.", - "required": true, - "schema": { - "$ref": "#/definitions/UnholdParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the unhold participant response" - } - }, - "x-ms-examples": { - "CallMedia_StopHoldMusic": { - "$ref": "./examples/CallMedia_StopHoldMusic.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/dialogs/{dialogId}": { - "put": { - "tags": [ - "MidConnections" - ], - "summary": "Start a dialog targeting a particular participant on the call.", - "description": "Start a dialog.", - "operationId": "CallDialog_StartDialog", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "dialogId", - "in": "path", - "description": "The dialog id", - "required": true, - "type": "string" - }, - { - "name": "startDialogRequest", - "in": "body", - "description": "The start dialog request", - "required": true, - "schema": { - "$ref": "#/definitions/StartDialogRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "201": { - "description": "Returns the start dialog response.", - "schema": { - "$ref": "#/definitions/DialogStateResponse" - } - } - }, - "x-ms-examples": { - "CallDialog_StartDialog": { - "$ref": "./examples/CallDialog_StartDialog.json" - } - } - }, - "delete": { - "tags": [ - "MidConnections" - ], - "summary": "Stop a dialog.", - "description": "Stop a dialog.", - "operationId": "CallDialog_StopDialog", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id", - "required": true, - "type": "string" - }, - { - "name": "dialogId", - "in": "path", - "description": "The dialog id", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "Returns no content for stop dialog response." - } - }, - "x-ms-examples": { - "CallDialog_StopDialog": { - "$ref": "./examples/CallDialog_StopDialog.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants": { - "get": { - "tags": [ - "MidConnections" - ], - "summary": "Get participants from a call. Recording and transcription bots are omitted from this list.", - "description": "Get participants from a call. Recording and transcription bots are omitted from this list.", - "operationId": "CallConnection_GetParticipants", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection Id", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the get participants response.", - "schema": { - "$ref": "#/definitions/GetParticipantsResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_GetParticipants": { - "$ref": "./examples/CallConnection_GetParticipants.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "values" - } - } - }, - "/calling/callConnections/{callConnectionId}/participants:add": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Add participants to the call.", - "description": "Add participants to the call.", - "operationId": "CallConnection_AddParticipant", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection Id", - "required": true, - "type": "string" - }, - { - "name": "addParticipantRequest", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the add participant request and will begin processing it. You will receive either AddParticipantSucceeded or AddParticipantFailed event at your specified callback URI to update you on the status of the request.", - "schema": { - "$ref": "#/definitions/AddParticipantResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_AddParticipant": { - "$ref": "./examples/CallConnection_AddParticipant.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants:remove": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Remove participant from the call using identifier.", - "description": "Remove participant from the call using identifier.", - "operationId": "CallConnection_RemoveParticipant", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "removeParticipantRequest", - "in": "body", - "description": "The participant to be removed from the call.", - "required": true, - "schema": { - "$ref": "#/definitions/RemoveParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the remove participant request and will begin processing it. You will receive either RemoveParticipantSucceeded or RemoveParticipantFailed event at your specified callback URI to update you on the status of the request.", - "schema": { - "$ref": "#/definitions/RemoveParticipantResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_RemoveParticipant": { - "$ref": "./examples/CallConnection_RemoveParticipant.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants:mute": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Mute participants from the call using identifier.", - "description": "Mute participants from the call using identifier.", - "operationId": "CallConnection_Mute", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "muteParticipantsRequest", - "in": "body", - "description": "The participants to be muted from the call.", - "required": true, - "schema": { - "$ref": "#/definitions/MuteParticipantsRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "Returns the mute participants response", - "schema": { - "$ref": "#/definitions/MuteParticipantsResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_Mute": { - "$ref": "./examples/CallConnection_Mute.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants:unmute": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Unmute participants from the call using identifier.", - "description": "Unmute participants from the call using identifier.", - "operationId": "CallConnection_Unmute", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection id.", - "required": true, - "type": "string" - }, - { - "name": "unmuteParticipantsRequest", - "in": "body", - "description": "The participants to be unmuted from the call.", - "required": true, - "schema": { - "$ref": "#/definitions/UnmuteParticipantsRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "Returns the unmute participants response", - "schema": { - "$ref": "#/definitions/UnmuteParticipantsResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_Unmute": { - "$ref": "./examples/CallConnection_Unmute.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants:cancelAddParticipant": { - "post": { - "tags": [ - "MidConnections" - ], - "summary": "Cancel add participant operation.", - "description": "Cancel add participant operation.", - "operationId": "CallConnection_CancelAddParticipant", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection Id", - "required": true, - "type": "string" - }, - { - "name": "cancelAddParticipantRequest", - "in": "body", - "description": "Cancellation request.", - "required": true, - "schema": { - "$ref": "#/definitions/CancelAddParticipantRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "Returns the cancelAddParticipant response", - "schema": { - "$ref": "#/definitions/CancelAddParticipantResponse" - } - } - }, - "x-ms-examples": { - "CallConnection_CancelAddParticipant": { - "$ref": "./examples/CallConnection_CancelAddParticipant.json" - } - } - } - }, - "/calling/callConnections/{callConnectionId}/participants/{participantRawId}": { - "get": { - "tags": [ - "MidConnections" - ], - "summary": "Get participant from a call.", - "description": "Get participant from a call.", - "operationId": "CallConnection_GetParticipant", - "parameters": [ - { - "name": "callConnectionId", - "in": "path", - "description": "The call connection Id", - "required": true, - "type": "string" - }, - { - "name": "participantRawId", - "in": "path", - "description": "Raw id of the participant to retrieve.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the detail of the requested participant.", - "schema": { - "$ref": "#/definitions/CallParticipant" - } - } - }, - "x-ms-examples": { - "CallConnection_GetParticipant": { - "$ref": "./examples/CallConnection_GetParticipant.json" - } - } - } - }, - "/calling/recordings": { - "post": { - "tags": [ - "Recording" - ], - "summary": "Start recording the call.", - "operationId": "CallRecording_StartRecording", - "parameters": [ - { - "name": "startCallRecording", - "in": "body", - "description": "The request body of start call recording request.", - "required": true, - "schema": { - "$ref": "#/definitions/StartCallRecordingRequest" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "Repeatability-Request-ID", - "in": "header", - "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.", - "type": "string", - "format": "uuid" - }, - { - "name": "Repeatability-First-Sent", - "in": "header", - "description": "If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.", - "type": "string", - "format": "date-time-rfc1123" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the start call recording response.", - "schema": { - "$ref": "#/definitions/RecordingStateResponse" - } - } - }, - "x-ms-examples": { - "CallRecording_StartRecording": { - "$ref": "./examples/CallRecording_StartRecording.json" - } - } - } - }, - "/calling/recordings/{recordingId}": { - "get": { - "tags": [ - "Recording" - ], - "summary": "Get call recording properties.", - "operationId": "CallRecording_GetRecordingProperties", - "parameters": [ - { - "name": "recordingId", - "in": "path", - "description": "The recording id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "200": { - "description": "Returns the recording properties.", - "schema": { - "$ref": "#/definitions/RecordingStateResponse" - } - } - }, - "x-ms-examples": { - "CallRecording_GetRecordingProperties": { - "$ref": "./examples/CallRecording_GetRecordingProperties.json" - } - } - }, - "delete": { - "tags": [ - "Recording" - ], - "summary": "Stop recording the call.", - "operationId": "CallRecording_StopRecording", - "parameters": [ - { - "name": "recordingId", - "in": "path", - "description": "The recording id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "204": { - "description": "Returns the stop call recording response." - } - }, - "x-ms-examples": { - "CallRecording_StopRecording": { - "$ref": "./examples/CallRecording_StopRecording.json" - } - } - } - }, - "/calling/recordings/{recordingId}:pause": { - "post": { - "tags": [ - "Recording" - ], - "summary": "Pause recording the call.", - "operationId": "CallRecording_PauseRecording", - "parameters": [ - { - "name": "recordingId", - "in": "path", - "description": "The recording id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the pause request and will begin processing it." - } - }, - "x-ms-examples": { - "CallRecording_PauseRecording": { - "$ref": "./examples/CallRecording_PauseRecording.json" - } - } - } - }, - "/calling/recordings/{recordingId}:resume": { - "post": { - "tags": [ - "Recording" - ], - "summary": "Resume recording the call.", - "operationId": "CallRecording_ResumeRecording", - "parameters": [ - { - "name": "recordingId", - "in": "path", - "description": "The recording id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/CommunicationErrorResponse" - } - }, - "202": { - "description": "The service has accepted the resume request and will begin processing it." - } - }, - "x-ms-examples": { - "CallRecording_ResumeRecording": { - "$ref": "./examples/CallRecording_ResumeRecording.json" - } - } - } - } - }, - "definitions": { - "CreateCallRequest": { - "description": "The request payload for creating the call.", - "required": [ - "targets", - "callbackUri" - ], - "type": "object", - "properties": { - "targets": { - "description": "The targets of the call.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "sourceCallerIdNumber": { - "$ref": "#/definitions/PhoneNumberIdentifierModel", - "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when calling a PSTN callee." - }, - "sourceDisplayName": { - "description": "Display name of the call if dialing out to a pstn number", - "type": "string" - }, - "sourceIdentity": { - "$ref": "#/definitions/CommunicationUserIdentifierModel", - "description": "The identifier of the source of the call" - }, - "operationContext": { - "description": "A customer set value used to track the answering of a call.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI.", - "type": "string" - }, - "mediaStreamingConfiguration": { - "$ref": "#/definitions/MediaStreamingConfiguration", - "description": "Media Streaming Configuration." - }, - "transcriptionConfiguration": { - "$ref": "#/definitions/TranscriptionConfiguration", - "description": "Live Transcription Configuration." - }, - "azureCognitiveServicesEndpointUrl": { - "description": "The identifier of the Cognitive Service resource assigned to this call.", - "type": "string" - }, - "customContext": { - "$ref": "#/definitions/CustomContext", - "description": "Used by customer to send custom context to targets" - } - } - }, - "CommunicationIdentifierModel": { - "$ref": "common.json#/definitions/CommunicationIdentifierModel" - }, - "PhoneNumberIdentifierModel": { - "$ref": "common.json#/definitions/PhoneNumberIdentifierModel" - }, - "CommunicationUserIdentifierModel": { - "$ref": "common.json#/definitions/CommunicationUserIdentifierModel" - }, - "MediaStreamingTransportType": { - "description": "The type of transport to be used for media streaming, eg. Websocket", - "enum": [ - "websocket" - ], - "type": "string", - "x-ms-enum": { - "name": "MediaStreamingTransportType", - "modelAsString": true - } - }, - "MediaStreamingContentType": { - "description": "Content type to stream, eg. audio, audio/video", - "enum": [ - "audio" - ], - "type": "string", - "x-ms-enum": { - "name": "MediaStreamingContentType", - "modelAsString": true - } - }, - "MediaStreamingAudioChannelType": { - "description": "Audio channel type to stream, eg. unmixed audio, mixed audio", - "enum": [ - "mixed", - "unmixed" - ], - "type": "string", - "x-ms-enum": { - "name": "MediaStreamingAudioChannelType", - "modelAsString": true - } - }, - "MediaStreamingConfiguration": { - "description": "Configuration of Media streaming.", - "required": [ - "transportUrl", - "transportType", - "contentType", - "audioChannelType" - ], - "type": "object", - "properties": { - "transportUrl": { - "description": "Transport URL for media streaming", - "type": "string" - }, - "transportType": { - "$ref": "#/definitions/MediaStreamingTransportType" - }, - "contentType": { - "$ref": "#/definitions/MediaStreamingContentType" - }, - "audioChannelType": { - "$ref": "#/definitions/MediaStreamingAudioChannelType" - } - } - }, - "TranscriptionTransportType": { - "description": "The type of transport to be used for live transcription, eg. Websocket", - "enum": [ - "websocket" - ], - "type": "string", - "x-ms-enum": { - "name": "TranscriptionTransportType", - "modelAsString": true - } - }, - "TranscriptionConfiguration": { - "description": "Configuration of live transcription.", - "required": [ - "transportUrl", - "transportType", - "locale", - "startTranscription" - ], - "type": "object", - "properties": { - "transportUrl": { - "description": "Transport URL for live transcription", - "type": "string" - }, - "transportType": { - "$ref": "#/definitions/TranscriptionTransportType" - }, - "locale": { - "description": "Defines the locale for the data e.g en-CA, en-AU", - "type": "string" - }, - "startTranscription": { - "description": "Determines if the transcription should be started immediately after call is answered or not.", - "type": "boolean" - } - } - }, - "CustomContext": { - "type": "object", - "properties": { - "voipHeaders": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "sipHeaders": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "CommunicationErrorResponse": { - "$ref": "common.json#/definitions/CommunicationErrorResponse" - }, - "CallConnectionStateModel": { - "description": "The state of the call connection.", - "enum": [ - "unknown", - "connecting", - "connected", - "transferring", - "transferAccepted", - "disconnecting", - "disconnected" - ], - "type": "string", - "x-ms-enum": { - "name": "CallConnectionStateModel", - "modelAsString": true - } - }, - "CallConnectionProperties": { - "description": "Properties of a call connection", - "type": "object", - "properties": { - "callConnectionId": { - "description": "The call connection id.", - "type": "string" - }, - "serverCallId": { - "description": "The server call id.", - "type": "string" - }, - "targets": { - "description": "The targets of the call.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "callConnectionState": { - "$ref": "#/definitions/CallConnectionStateModel" - }, - "callbackUri": { - "description": "The callback URI.", - "type": "string" - }, - "mediaSubscriptionId": { - "description": "SubscriptionId for media streaming", - "type": "string" - }, - "dataSubscriptionId": { - "description": "SubscriptionId for transcription", - "type": "string" - }, - "sourceCallerIdNumber": { - "$ref": "#/definitions/PhoneNumberIdentifierModel", - "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when calling a PSTN callee." - }, - "sourceDisplayName": { - "description": "Display name of the call if dialing out to a pstn number.", - "type": "string" - }, - "sourceIdentity": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Source identity." - }, - "correlationId": { - "description": "The correlation ID.", - "type": "string" - }, - "answeredByIdentifier": { - "$ref": "#/definitions/CommunicationUserIdentifierModel", - "description": "Identity of the answering entity. Only populated when identity is provided in the request." - } - } - }, - "AnswerCallRequest": { - "description": "The request payload for answering the call.", - "required": [ - "incomingCallContext", - "callbackUri" - ], - "type": "object", - "properties": { - "incomingCallContext": { - "description": "The context associated with the call.", - "type": "string" - }, - "callbackUri": { - "description": "The callback uri.", - "type": "string" - }, - "operationContext": { - "description": "A customer set value used to track the answering of a call.", - "type": "string" - }, - "mediaStreamingConfiguration": { - "$ref": "#/definitions/MediaStreamingConfiguration", - "description": "Media Streaming Configuration." - }, - "transcriptionConfiguration": { - "$ref": "#/definitions/TranscriptionConfiguration", - "description": "Live Transcription Configuration." - }, - "azureCognitiveServicesEndpointUrl": { - "description": "The endpoint URL of the Azure Cognitive Services resource attached", - "type": "string" - }, - "answeredByIdentifier": { - "$ref": "#/definitions/CommunicationUserIdentifierModel", - "description": "The identifier of the call automation entity which answers the call" - } - } - }, - "RedirectCallRequest": { - "description": "The request payload for redirecting the call.", - "required": [ - "incomingCallContext", - "target" - ], - "type": "object", - "properties": { - "incomingCallContext": { - "description": "The context associated with the call.", - "type": "string" - }, - "target": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "The target identity to redirect the call to." - }, - "customContext": { - "$ref": "#/definitions/CustomContext", - "description": "Used by customer to send custom context to targets" - } - } - }, - "CallRejectReason": { - "description": "The rejection reason.", - "enum": [ - "none", - "busy", - "forbidden" - ], - "type": "string", - "x-ms-enum": { - "name": "CallRejectReason", - "modelAsString": true - } - }, - "RejectCallRequest": { - "description": "The request payload for rejecting the call.", - "required": [ - "incomingCallContext" - ], - "type": "object", - "properties": { - "incomingCallContext": { - "description": "The context associated with the call.", - "type": "string" - }, - "callRejectReason": { - "$ref": "#/definitions/CallRejectReason" - } - } - }, - "TransferToParticipantRequest": { - "description": "The request payload for transferring call to a participant.", - "required": [ - "targetParticipant" - ], - "type": "object", - "properties": { - "targetParticipant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "The identity of the target where call should be transferred to." - }, - "customContext": { - "$ref": "#/definitions/CustomContext", - "description": "Used by customer to send custom context to targets" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "transferee": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Transferee is the participant who is transferring the call." - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "TransferCallResponse": { - "description": "The response payload for transferring the call.", - "type": "object", - "properties": { - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - } - } - }, - "PlayRequest": { - "required": [ - "playSourceInfo" - ], - "type": "object", - "properties": { - "playSourceInfo": { - "$ref": "#/definitions/PlaySource", - "description": "The source of the audio to be played." - }, - "playTo": { - "description": "The list of call participants play provided audio to.\r\nPlays to everyone in the call when not provided.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "playOptions": { - "$ref": "#/definitions/PlayOptions", - "description": "Defines options for playing the audio." - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "PlaySourceType": { - "description": "Defines the type of the play source", - "enum": [ - "file", - "text", - "ssml" - ], - "type": "string", - "x-ms-enum": { - "name": "PlaySourceType", - "modelAsString": true - } - }, - "PlaySource": { - "required": [ - "sourceType" - ], - "type": "object", - "properties": { - "sourceType": { - "$ref": "#/definitions/PlaySourceType" - }, - "playSourceId": { - "description": "Defines the identifier to be used for caching related media", - "type": "string" - }, - "fileSource": { - "$ref": "#/definitions/FileSource", - "description": "Defines the file source info to be used for play" - }, - "textSource": { - "$ref": "#/definitions/TextSource", - "description": "Defines the text source info to be used for play" - }, - "ssmlSource": { - "$ref": "#/definitions/SsmlSource", - "description": "Defines the ssml(Speech Synthesis Markup Language) source info to be used for play" - } - } - }, - "PlayOptions": { - "required": [ - "loop" - ], - "type": "object", - "properties": { - "loop": { - "description": "The option to play the provided audio source in loop when set to true", - "type": "boolean" - } - } - }, - "FileSource": { - "required": [ - "uri" - ], - "type": "object", - "properties": { - "uri": { - "description": "Uri for the audio file to be played", - "type": "string" - } - } - }, - "Gender": { - "description": "Voice gender type", - "enum": [ - "male", - "female" - ], - "type": "string", - "x-ms-enum": { - "name": "Gender", - "modelAsString": true - } - }, - "TextSource": { - "required": [ - "text" - ], - "type": "object", - "properties": { - "text": { - "description": "Text for the cognitive service to be played", - "type": "string" - }, - "sourceLocale": { - "description": "Source language locale to be played\r\nRefer to available locales here: ", - "type": "string" - }, - "voiceGender": { - "$ref": "#/definitions/Gender" - }, - "voiceName": { - "description": "Voice name to be played\r\nRefer to available Text-to-speech voices here: ", - "type": "string" - }, - "customVoiceEndpointId": { - "description": "Endpoint where the custom voice was deployed.", - "type": "string" - } - } - }, - "SsmlSource": { - "required": [ - "ssmlText" - ], - "type": "object", - "properties": { - "ssmlText": { - "description": "Ssml string for the cognitive service to be played", - "type": "string" - }, - "customVoiceEndpointId": { - "description": "Endpoint where the custom voice was deployed.", - "type": "string" - } - } - }, - "RecognizeInputType": { - "description": "Determines the type of the recognition.", - "enum": [ - "dtmf", - "speech", - "speechOrDtmf", - "choices" - ], - "type": "string", - "x-ms-enum": { - "name": "RecognizeInputType", - "modelAsString": true - } - }, - "RecognizeRequest": { - "required": [ - "recognizeInputType", - "recognizeOptions" - ], - "type": "object", - "properties": { - "recognizeInputType": { - "$ref": "#/definitions/RecognizeInputType" - }, - "playPrompt": { - "$ref": "#/definitions/PlaySource", - "description": "The source of the audio to be played for recognition." - }, - "interruptCallMediaOperation": { - "description": "If set recognize can barge into other existing queued-up/currently-processing requests.", - "type": "boolean" - }, - "recognizeOptions": { - "$ref": "#/definitions/RecognizeOptions", - "description": "Defines options for recognition." - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "RecognizeOptions": { - "required": [ - "targetParticipant" - ], - "type": "object", - "properties": { - "interruptPrompt": { - "description": "Determines if we interrupt the prompt and start recognizing.", - "type": "boolean" - }, - "initialSilenceTimeoutInSeconds": { - "format": "int32", - "description": "Time to wait for first input after prompt (if any).", - "maximum": 300, - "minimum": 0, - "type": "integer" - }, - "targetParticipant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Target participant of DTMF tone recognition." - }, - "speechLanguage": { - "description": "Speech language to be recognized, If not set default is en-US", - "type": "string" - }, - "speechRecognitionModelEndpointId": { - "description": "Endpoint where the custom model was deployed.", - "type": "string" - }, - "dtmfOptions": { - "$ref": "#/definitions/DtmfOptions", - "description": "Defines configurations for DTMF." - }, - "choices": { - "description": "Defines Ivr choices for recognize.", - "type": "array", - "items": { - "$ref": "#/definitions/Choice" - } - }, - "speechOptions": { - "$ref": "#/definitions/SpeechOptions", - "description": "Defines continuous speech recognition option." - } - } - }, - "Tone": { - "enum": [ - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "a", - "b", - "c", - "d", - "pound", - "asterisk" - ], - "type": "string", - "x-ms-enum": { - "name": "Tone", - "modelAsString": true - } - }, - "DtmfOptions": { - "description": "Options for DTMF recognition", - "type": "object", - "properties": { - "interToneTimeoutInSeconds": { - "format": "int32", - "description": "Time to wait between DTMF inputs to stop recognizing.", - "maximum": 60, - "minimum": 1, - "type": "integer" - }, - "maxTonesToCollect": { - "format": "int32", - "description": "Maximum number of DTMF tones to be collected.", - "type": "integer" - }, - "stopTones": { - "description": "List of tones that will stop recognizing.", - "type": "array", - "items": { - "$ref": "#/definitions/Tone" - } - } - } - }, - "Choice": { - "required": [ - "label", - "phrases" - ], - "type": "object", - "properties": { - "label": { - "description": "Identifier for a given choice", - "type": "string" - }, - "phrases": { - "description": "List of phrases to recognize", - "type": "array", - "items": { - "type": "string" - } - }, - "tone": { - "$ref": "#/definitions/Tone" - } - } - }, - "SpeechOptions": { - "description": "Options for continuous speech recognition", - "type": "object", - "properties": { - "endSilenceTimeoutInMs": { - "format": "int64", - "description": "The length of end silence when user stops speaking and cogservice send response.", - "type": "integer" - } - } - }, - "ContinuousDtmfRecognitionRequest": { - "required": [ - "targetParticipant" - ], - "type": "object", - "properties": { - "targetParticipant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Defines options for recognition." - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "SendDtmfRequest": { - "required": [ - "tones", - "targetParticipant" - ], - "type": "object", - "properties": { - "tones": { - "description": "List of tones to be sent to target participant.", - "type": "array", - "items": { - "$ref": "#/definitions/Tone" - } - }, - "targetParticipant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Target participant of send DTMF." - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "HoldParticipantRequest": { - "description": "The request payload for holding participant from the call.", - "required": [ - "participantToHold", - "playSourceInfo" - ], - "type": "object", - "properties": { - "participantToHold": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant to be held from the call." - }, - "playSourceInfo": { - "$ref": "#/definitions/PlaySource", - "description": "Prompt to play while in hold." - }, - "loop": { - "description": "If the prompt will be looped or not.", - "type": "boolean" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "UnholdParticipantRequest": { - "description": "The request payload for holding participant from the call.", - "required": [ - "participantToUnhold" - ], - "type": "object", - "properties": { - "participantToUnhold": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participants to be hold from the call.\r\nOnly ACS Users are supported." - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "DialogInputType": { - "description": "Determines the type of the dialog.", - "enum": [ - "powerVirtualAgents" - ], - "type": "string", - "x-ms-enum": { - "name": "DialogInputType", - "modelAsString": true - } - }, - "StartDialogRequest": { - "required": [ - "dialogOptions", - "dialogInputType" - ], - "type": "object", - "properties": { - "dialogOptions": { - "$ref": "#/definitions/DialogOptions", - "description": "Defines options for dialog." - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - } - } - }, - "DialogOptions": { - "required": [ - "botAppId", - "dialogContext" - ], - "type": "object", - "properties": { - "botAppId": { - "description": "Bot identifier.", - "type": "string" - }, - "dialogContext": { - "description": "Dialog context.", - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - }, - "DialogStateResponse": { - "type": "object", - "properties": { - "dialogId": { - "description": "The dialog ID.", - "type": "string" - }, - "dialogOptions": { - "$ref": "#/definitions/DialogOptions", - "description": "Defines options for dialog." - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "operationContext": { - "description": "The value to identify context of the operation.", - "type": "string" - } - } - }, - "GetParticipantsResponse": { - "description": "The response payload for getting participants of the call.", - "type": "object", - "properties": { - "values": { - "description": "List of the current participants in the call.", - "type": "array", - "items": { - "$ref": "#/definitions/CallParticipant" - } - }, - "nextLink": { - "description": "Continue of the list of participants", - "type": "string" - } - } - }, - "CallParticipant": { - "description": "Contract model of an ACS call participant", - "type": "object", - "properties": { - "identifier": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Communication identifier of the participant" - }, - "isMuted": { - "description": "Is participant muted", - "type": "boolean" - } - } - }, - "AddParticipantRequest": { - "description": "The request payload for adding participant to the call.", - "required": [ - "participantToAdd" - ], - "type": "object", - "properties": { - "sourceCallerIdNumber": { - "$ref": "#/definitions/PhoneNumberIdentifierModel", - "description": "The source caller Id, a phone number, that's shown to the PSTN participant being invited.\r\nRequired only when inviting a PSTN participant." - }, - "sourceDisplayName": { - "description": "(Optional) The display name of the source that is associated with this invite operation when\r\nadding a PSTN participant or teams user. Note: Will not update the display name in the roster.", - "type": "string" - }, - "participantToAdd": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "The participant to invite." - }, - "invitationTimeoutInSeconds": { - "format": "int32", - "description": "Gets or sets the timeout to wait for the invited participant to pickup.\r\nThe maximum value of this is 180 seconds", - "maximum": 180, - "minimum": 0, - "type": "integer" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "customContext": { - "$ref": "#/definitions/CustomContext", - "description": "Used by customer to send custom context to targets" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "AddParticipantResponse": { - "description": "The response payload for adding participants to the call.", - "type": "object", - "properties": { - "participant": { - "$ref": "#/definitions/CallParticipant", - "description": "List of current participants in the call." - }, - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - }, - "invitiationId": { - "description": "Invitation ID used to add a participant.", - "type": "string" - } - } - }, - "RemoveParticipantRequest": { - "description": "The remove participant by identifier request.", - "required": [ - "participantToRemove" - ], - "type": "object", - "properties": { - "participantToRemove": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "The participants to be removed from the call." - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "RemoveParticipantResponse": { - "description": "The response payload for removing participants of the call.", - "type": "object", - "properties": { - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - } - } - }, - "MuteParticipantsRequest": { - "description": "The request payload for muting participants from the call.", - "required": [ - "targetParticipants" - ], - "type": "object", - "properties": { - "targetParticipants": { - "description": "Participants to be muted from the call.\r\nOnly ACS Users are supported.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "MuteParticipantsResponse": { - "description": "The response payload for muting participants from the call.", - "type": "object", - "properties": { - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - } - } - }, - "UnmuteParticipantsRequest": { - "description": "The request payload for unmuting participant from the call.", - "required": [ - "targetParticipants" - ], - "type": "object", - "properties": { - "targetParticipants": { - "description": "Participants to be unmuted from the call.\r\nOnly ACS Users are supported.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "UnmuteParticipantsResponse": { - "description": "The response payload for unmuting participants from the call.", - "type": "object", - "properties": { - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - } - } - }, - "CancelAddParticipantRequest": { - "required": [ - "invitiationId" - ], - "type": "object", - "properties": { - "invitiationId": { - "description": "Invitation ID used to add a participant.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "callbackUri": { - "description": "The callback URI to override the main callback URI.", - "type": "string" - } - } - }, - "CancelAddParticipantResponse": { - "type": "object", - "properties": { - "invitationId": { - "description": "Invitation ID used to cancel the add participant action.", - "type": "string" - }, - "operationContext": { - "description": "The operation context provided by client.", - "type": "string" - } - } - }, - "RecordingContentType": { - "description": "The content type of call recording.", - "enum": [ - "audio", - "audioVideo" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingContentType", - "modelAsString": true - } - }, - "RecordingChannelType": { - "description": "The channel type of call recording.", - "enum": [ - "mixed", - "unmixed" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingChannelType", - "modelAsString": true - } - }, - "RecordingFormatType": { - "description": "The format type of call recording.", - "enum": [ - "wav", - "mp3", - "mp4" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingFormatType", - "modelAsString": true - } - }, - "StartCallRecordingRequest": { - "description": "The request payload start for call recording operation with call locator.", - "required": [ - "callLocator" - ], - "type": "object", - "properties": { - "callLocator": { - "$ref": "#/definitions/CallLocator", - "description": "The call locator." - }, - "recordingStateCallbackUri": { - "description": "The uri to send notifications to.", - "type": "string" - }, - "recordingContentType": { - "$ref": "#/definitions/RecordingContentType" - }, - "recordingChannelType": { - "$ref": "#/definitions/RecordingChannelType" - }, - "recordingFormatType": { - "$ref": "#/definitions/RecordingFormatType" - }, - "audioChannelParticipantOrdering": { - "description": "The sequential order in which audio channels are assigned to participants in the unmixed recording.\r\nWhen 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified,\r\nthe audio channel to participant mapping will be automatically assigned based on the order in which participant\r\nfirst audio was detected. Channel to participant mapping details can be found in the metadata of the recording.", - "type": "array", - "items": { - "$ref": "#/definitions/CommunicationIdentifierModel" - } - }, - "channelAffinity": { - "description": "The channel affinity of call recording\r\nWhen 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned.\r\nChannel-Participant mapping details can be found in the metadata of the recording.\r\n///", - "type": "array", - "items": { - "$ref": "#/definitions/ChannelAffinity" - } - }, - "externalStorage": { - "$ref": "#/definitions/ExternalStorage", - "description": "Optional property to specify location where recording will be stored" - } - } - }, - "CallLocatorKind": { - "description": "The call locator kind.", - "enum": [ - "groupCallLocator", - "serverCallLocator" - ], - "type": "string", - "x-ms-enum": { - "name": "CallLocatorKind", - "modelAsString": true - } - }, - "CallLocator": { - "description": "The locator used for joining or taking action on a call.", - "type": "object", - "properties": { - "groupCallId": { - "description": "The group call id", - "type": "string" - }, - "serverCallId": { - "description": "The server call id.", - "type": "string" - }, - "kind": { - "$ref": "#/definitions/CallLocatorKind" - } - } - }, - "ChannelAffinity": { - "description": "Channel affinity for a participant", - "required": [ - "participant" - ], - "type": "object", - "properties": { - "channel": { - "format": "int32", - "description": "Channel number to which bitstream from a particular participant will be written.", - "maximum": 4, - "minimum": 0, - "type": "integer" - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "The identifier for the participant whose bitstream will be written to the channel \r\nrepresented by the channel number." - } - } - }, - "RecordingStorageType": { - "description": "Defines the type of external storage", - "enum": [ - "acs", - "blobStorage" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingStorageType", - "modelAsString": true - } - }, - "ExternalStorage": { - "required": [ - "storageType" - ], - "type": "object", - "properties": { - "storageType": { - "$ref": "#/definitions/RecordingStorageType" - }, - "blobStorage": { - "$ref": "#/definitions/BlobStorage", - "description": "Defines the blob storage location where the recording will be stored" - } - } - }, - "BlobStorage": { - "description": "Used to specify Blob container url to recording storage", - "required": [ - "containerUri" - ], - "type": "object", - "properties": { - "containerUri": { - "description": "Url of a container or a location within a container", - "type": "string" - } - } - }, - "RecordingState": { - "enum": [ - "active", - "inactive" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingState", - "modelAsString": true - } - }, - "RecordingType": { - "enum": [ - "acs", - "teams" - ], - "type": "string", - "x-ms-enum": { - "name": "RecordingType", - "modelAsString": true - } - }, - "RecordingStateResponse": { - "type": "object", - "properties": { - "recordingId": { - "type": "string" - }, - "recordingState": { - "$ref": "#/definitions/RecordingState" - }, - "recordingType": { - "$ref": "#/definitions/RecordingType" - } - } - }, - "AddParticipantFailed": { - "description": "The failed to add participant event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant" - } - } - }, - "ResultInformation": { - "type": "object", - "properties": { - "code": { - "format": "int32", - "description": "Code of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected.", - "type": "integer" - }, - "subCode": { - "format": "int32", - "description": "Subcode of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected.", - "type": "integer" - }, - "message": { - "description": "Detail message that describes the current result.", - "type": "string" - } - } - }, - "AddParticipantSucceeded": { - "description": "The participant successfully added event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant" - } - } - }, - "CallConnected": { - "description": "The call connected event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers to set the context for creating a new call. This property will be null for answering a call.", - "type": "string" - } - } - }, - "CallDisconnected": { - "description": "The call disconnected event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers to set the context for creating a new call. This property will be null for answering a call.", - "type": "string" - } - } - }, - "CallTransferAccepted": { - "description": "The call transfer accepted event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "transferTarget": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Traffer target: the user that transferee will be transferred to", - "readOnly": true - }, - "transferee": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Transferee: the participant being transferred away", - "readOnly": true - } - } - }, - "CallTransferFailed": { - "description": "The call transfer failed event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - } - } - }, - "ParticipantsUpdated": { - "description": "The participants updated in a call event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "sequenceNumber": { - "format": "int32", - "description": "The Sequence Number of the event", - "type": "integer" - }, - "participants": { - "description": "The list of participants in the call.", - "type": "array", - "items": { - "$ref": "#/definitions/CallParticipant" - } - } - } - }, - "RemoveParticipantSucceeded": { - "description": "The participant removed event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant" - } - } - }, - "RemoveParticipantFailed": { - "description": "The failed to remove participant event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant" - } - } - }, - "AddParticipantCancelled": { - "description": "Successful cancel add participant event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "participant": { - "$ref": "#/definitions/CommunicationIdentifierModel", - "description": "Participant that has been cancelled." - }, - "invitiationId": { - "description": "Invitation ID used to cancel the request.", - "type": "string" - } - } - }, - "CancelAddParticipantFailed": { - "description": "Failed cancel add participant event.", - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services." - }, - "invitiationId": { - "description": "Invitation ID used to cancel the request.", - "type": "string" - } - } - }, - "RecordingStateChanged": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "recordingId": { - "description": "The call recording id", - "type": "string", - "readOnly": true - }, - "state": { - "$ref": "#/definitions/RecordingState" - }, - "startDateTime": { - "format": "date-time", - "description": "The time of the recording started", - "type": "string", - "readOnly": true - } - } - }, - "PlayCompleted": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - }, - "PlayFailed": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - }, - "PlayCanceled": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "RecognitionType": { - "description": "Determines the sub-type of the recognize operation.\r\nIn case of cancel operation the this field is not set and is returned empty", - "enum": [ - "dtmf", - "speech", - "choices" - ], - "type": "string", - "x-ms-enum": { - "name": "RecognitionType", - "modelAsString": true - } - }, - "RecognizeCompleted": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - }, - "recognitionType": { - "$ref": "#/definitions/RecognitionType" - }, - "collectTonesResult": { - "$ref": "#/definitions/CollectTonesResult", - "description": "Defines the result for RecognitionType = Dtmf\r\nWould be replaced by DtmfResult after server sdk renewed" - }, - "dtmfResult": { - "$ref": "#/definitions/DtmfResult", - "description": "Defines the result for RecognitionType = Dtmf" - }, - "choiceResult": { - "$ref": "#/definitions/ChoiceResult", - "description": "Defines the result for RecognitionType = Choices" - }, - "speechResult": { - "$ref": "#/definitions/SpeechResult", - "description": "Defines the result for RecognitionType = Speech and SpeechOrDtmf", - "readOnly": true - } - } - }, - "CollectTonesResult": { - "type": "object", - "properties": { - "tones": { - "type": "array", - "items": { - "$ref": "#/definitions/Tone" - }, - "readOnly": true - } - } - }, - "DtmfResult": { - "type": "object", - "properties": { - "tones": { - "type": "array", - "items": { - "$ref": "#/definitions/Tone" - }, - "readOnly": true - } - } - }, - "ChoiceResult": { - "type": "object", - "properties": { - "label": { - "description": "Label is the primary identifier for the choice detected", - "type": "string" - }, - "recognizedPhrase": { - "description": "Phrases are set to the value if choice is selected via phrase detection.\r\nIf Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to null", - "type": "string" - } - } - }, - "SpeechResult": { - "description": "The speech status as a result.", - "type": "object", - "properties": { - "speech": { - "description": "The recognized speech in string.", - "type": "string" - } - } - }, - "RecognizeFailed": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - }, - "RecognizeCanceled": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "DialogCompleted": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - } - } - }, - "DialogFailed": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - } - } - }, - "DialogConsent": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "userConsent": { - "$ref": "#/definitions/UserConsent", - "description": "UserConsent data from the Conversation Conductor", - "readOnly": true - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - } - } - }, - "UserConsent": { - "type": "object", - "properties": { - "recording": { - "format": "int32", - "type": "integer" - } - } - }, - "DialogStarted": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - } - } - }, - "DialogHangup": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - }, - "ivrContext": { - "description": "Ivr Context", - "type": "object", - "readOnly": true - } - } - }, - "DialogTransfer": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - }, - "transferType": { - "description": "Transfer type", - "type": "string", - "readOnly": true - }, - "transferDestination": { - "description": "Transfer destination", - "type": "string", - "readOnly": true - }, - "ivrContext": { - "description": "IVR context", - "type": "object", - "readOnly": true - } - } - }, - "DialogLanguageChange": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - }, - "selectedLanguage": { - "description": "Selected Language", - "type": "string", - "readOnly": true - }, - "ivrContext": { - "description": "Ivr Context", - "type": "object", - "readOnly": true - } - } - }, - "DialogSensitivityUpdate": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string", - "readOnly": true - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId for skype chain ID.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling answerCall action to correlate the request to the response event.", - "type": "string", - "readOnly": true - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code/sub-code and message from NGC services.", - "readOnly": true - }, - "dialogInputType": { - "$ref": "#/definitions/DialogInputType" - }, - "dialogId": { - "description": "Dialog ID", - "type": "string", - "readOnly": true - }, - "sensitiveMask": { - "description": "SensitiveMask", - "type": "boolean", - "readOnly": true - } - } - }, - "ContinuousDtmfRecognitionToneFailed": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "ContinuousDtmfRecognitionToneReceived": { - "type": "object", - "properties": { - "toneInfo": { - "$ref": "#/definitions/ToneInfo", - "description": "Information about Tone." - }, - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation. Also called ChainId or skype chain ID.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - } - } - }, - "ToneInfo": { - "description": "The information about the tone.", - "required": [ - "sequenceId", - "tone" - ], - "type": "object", - "properties": { - "sequenceId": { - "format": "int32", - "description": "The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed.", - "type": "integer" - }, - "tone": { - "$ref": "#/definitions/Tone" - } - } - }, - "ContinuousDtmfRecognitionStopped": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - }, - "SendDtmfCompleted": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - }, - "SendDtmfFailed": { - "type": "object", - "properties": { - "callConnectionId": { - "description": "Call connection ID.", - "type": "string" - }, - "serverCallId": { - "description": "Server call ID.", - "type": "string" - }, - "correlationId": { - "description": "Correlation ID for event to call correlation.", - "type": "string" - }, - "operationContext": { - "description": "Used by customers when calling mid-call actions to correlate the request to the response event.", - "type": "string" - }, - "resultInformation": { - "$ref": "#/definitions/ResultInformation", - "description": "Contains the resulting SIP code, sub-code and message." - } - } - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "description": "Version of API to invoke.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "Endpoint": { - "name": "endpoint", - "in": "path", - "description": "The endpoint of the Azure Communication resource.", - "required": true, - "type": "string", - "format": "url", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - } - }, - "securityDefinitions": { - "Authorization": { - "type": "apiKey", - "description": "An Azure Communication Services user access token.", - "name": "Authorization", - "in": "header" - } - }, - "security": [ - { - "Authorization": [] - } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}", - "useSchemePrefix": false, - "parameters": [ - { - "$ref": "#/parameters/Endpoint" - } - ] - } -} From a2fef87755cf1682e84047680827474ce173334c Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Wed, 20 Sep 2023 11:38:21 -0700 Subject: [PATCH 03/10] Fixing last merge --- .../src/Models/Events/CallTransferAccepted.cs | 5 ----- .../src/Models/Events/SensitiveFlag.cs | 12 ------------ 2 files changed, 17 deletions(-) delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs index d53dbef3acd3..f8021ec96151 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallTransferAccepted.cs @@ -47,10 +47,5 @@ public static CallTransferAccepted Deserialize(string content) var internalEvent = CallTransferAcceptedInternal.DeserializeCallTransferAcceptedInternal(element); return new CallTransferAccepted(internalEvent); } - - /// Traffer target: the user that transferee will be transferred to. - internal CommunicationIdentifierModel TransferTarget { get; } - /// Transferee: the participant being transferred away. - internal CommunicationIdentifierModel Transferee { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs deleted file mode 100644 index 5d5ee396e90c..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/SensitiveFlag.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - [CodeGenModel("SensitiveFlag", Usage = new string[] { "output" }, Formats = new string[] { "json" })] - public partial class SensitiveFlag - { - } -} From 065a595f2a4061c45bf08113e7f331a149531e06 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Wed, 20 Sep 2023 12:08:02 -0700 Subject: [PATCH 04/10] Adding tests and missing apis --- .../src/CallMedia.cs | 60 +++++++++++++++++-- ...antOptions.cs => StartHoldMusicOptions.cs} | 4 +- ...antsOptions.cs => StopHoldMusicOptions.cs} | 4 +- .../tests/CallMedias/CallMediaTests.cs | 60 +++++++++++++++++++ 4 files changed, 120 insertions(+), 8 deletions(-) rename sdk/communication/Azure.Communication.CallAutomation/src/Models/{HoldParticipantOptions.cs => StartHoldMusicOptions.cs} (90%) rename sdk/communication/Azure.Communication.CallAutomation/src/Models/{UnholdParticipantsOptions.cs => StopHoldMusicOptions.cs} (87%) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs index 97c53ce4dad6..31067b8393e9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs @@ -399,7 +399,36 @@ public virtual Response StartRecognizing(CallMe /// The options. /// /// - public virtual async Task StartHoldMusicAsync(HoldParticipantOptions options, CancellationToken cancellationToken = default) + public virtual Response StartHoldMusic(StartHoldMusicOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusic)}"); + scope.Start(); + try + { + var request = new HoldParticipantRequestInternal( + CommunicationIdentifierSerializer.Serialize(options.TargetParticipant), + TranslatePlaySourceToInternal(options.PlaySourceInfo)) + { + Loop = options.Loop, + OperationContext = options.OperationContext, + }; + + return CallMediaRestClient.StartHoldMusic(CallConnectionId, request, cancellationToken: cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Hold participant. + /// + /// The options. + /// + /// + public virtual async Task StartHoldMusicAsync(StartHoldMusicOptions options, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusicAsync)}"); scope.Start(); @@ -423,14 +452,14 @@ public virtual async Task StartHoldMusicAsync(HoldParticipantOptions o } /// - /// Hold participant. + /// Remove hold from participant. /// /// The options. /// /// - public virtual async Task UnholdParticipantAsync(UnholdParticipantsOptions options, CancellationToken cancellationToken = default) + public virtual async Task StopHoldMusicAsync(StopHoldMusicOptions options, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UnholdParticipantAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); scope.Start(); try { @@ -445,6 +474,29 @@ public virtual async Task UnholdParticipantAsync(UnholdParticipantsOpt } } + /// + /// Remove hold from participant. + /// + /// The options. + /// + /// + public virtual Response StopHoldMusic(StopHoldMusicOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); + scope.Start(); + try + { + UnholdParticipantRequestInternal request = new UnholdParticipantRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + + return CallMediaRestClient.StopHoldMusic(CallConnectionId, request, cancellationToken: cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecognizeOptions recognizeOptions) { if (recognizeOptions == null) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs similarity index 90% rename from sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs index 2c2399010e3f..627df986857e 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs @@ -10,12 +10,12 @@ namespace Azure.Communication.CallAutomation /// /// Options for the Unmute Participant Request. /// - public class HoldParticipantOptions + public class StartHoldMusicOptions { /// /// Creates a new UnmuteParticipantOptions object. /// - public HoldParticipantOptions(CommunicationIdentifier targetParticipant) + public StartHoldMusicOptions(CommunicationIdentifier targetParticipant) { TargetParticipant = targetParticipant; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs similarity index 87% rename from sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs index 7dd40aa55670..24fd27679fe8 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantsOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs @@ -6,12 +6,12 @@ namespace Azure.Communication.CallAutomation /// /// Options for the Unmute Participant Request. /// - public class UnholdParticipantsOptions + public class StopHoldMusicOptions { /// /// Creates a new UnmuteParticipantOptions object. /// - public UnholdParticipantsOptions(CommunicationIdentifier targetParticipant) + public StopHoldMusicOptions(CommunicationIdentifier targetParticipant) { TargetParticipant = targetParticipant; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs index ede7e47b1346..ac78adb82efb 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs @@ -141,6 +141,18 @@ public class CallMediaTests : CallAutomationTestBase private static readonly CallMediaRecognizeOptions _emptyRecognizeOptions = new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier("targetUserId"), maxTonesToCollect: 1); + private static readonly StartHoldMusicOptions _startHoldMusicOptions = new StartHoldMusicOptions(new CommunicationUserIdentifier("targetUserId")) + { + PlaySourceInfo = _textSource, + Loop = true, + OperationContext = "operationContext" + }; + + private static readonly StopHoldMusicOptions _stopHoldMusicOptions = new StopHoldMusicOptions(new CommunicationUserIdentifier("targetUserId")) + { + OperationContext = "operationContext" + }; + private static CallMedia? _callMedia; [SetUp] @@ -395,6 +407,24 @@ public void StopContinuousRecognizeOperations_Return404NotFound(Func> operation) + { + _callMedia = GetCallMedia(200); + var result = await operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, result.Status); + } + + [TestCaseSource(nameof(TestData_HoldOperations))] + public void HoldMusicOperations_Return200Ok(Func operation) + { + _callMedia = GetCallMedia(200); + var result = operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, result.Status); + } + private static IEnumerable TestData_PlayOperationsAsync() { return new[] @@ -605,5 +635,35 @@ public void StopContinuousRecognizeOperations_Return404NotFound(Func TestData_HoldOperationsAsync() + { + return new[] + { + new Func>?[] + { + callMedia => callMedia.StartHoldMusicAsync(_startHoldMusicOptions) + }, + new Func>?[] + { + callMedia => callMedia.StopHoldMusicAsync(_stopHoldMusicOptions) + } + }; + } + + private static IEnumerable TestData_HoldOperations() + { + return new[] + { + new Func?[] + { + callMedia => callMedia.StartHoldMusic(_startHoldMusicOptions) + }, + new Func?[] + { + callMedia => callMedia.StopHoldMusic(_stopHoldMusicOptions) + } + }; + } } } From cd857d231b2d9d7335b93506ea90ad9c721f49e6 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Wed, 20 Sep 2023 12:11:30 -0700 Subject: [PATCH 05/10] Exporting new APIs --- ...unication.CallAutomation.netstandard2.0.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs index 73362fd98928..17a63a98b593 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs @@ -274,10 +274,14 @@ protected CallMedia() { } public virtual System.Threading.Tasks.Task> SendDtmfAsync(System.Collections.Generic.IEnumerable tones, Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Uri callbackUri = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StartHoldMusic(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartHoldMusicAsync(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartRecognizing(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartRecognizingAsync(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StopContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Uri callbackUri = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Uri callbackUri = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StopHoldMusic(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopHoldMusicAsync(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CallMediaRecognitionType : System.IEquatable @@ -633,6 +637,7 @@ internal DialogHangup() { } private readonly object _dummy; private readonly int _dummyPrimitive; public DialogInputType(string value) { throw null; } + public static Azure.Communication.CallAutomation.DialogInputType AzureOpenAI { get { throw null; } } public static Azure.Communication.CallAutomation.DialogInputType PowerVirtualAgents { get { throw null; } } public bool Equals(Azure.Communication.CallAutomation.DialogInputType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1270,6 +1275,14 @@ public StartDialogOptions(string dialogId, Azure.Communication.CallAutomation.Di public Azure.Communication.CallAutomation.DialogInputType DialogInputType { get { throw null; } } public string OperationContext { get { throw null; } set { } } } + public partial class StartHoldMusicOptions + { + public StartHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { } + public bool Loop { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } + public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } + } public partial class StartRecognizingCallMediaResult { internal StartRecognizingCallMediaResult() { } @@ -1294,6 +1307,23 @@ public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator call public Azure.Communication.CallAutomation.RecordingFormat RecordingFormat { get { throw null; } set { } } public System.Uri RecordingStateCallbackUri { get { throw null; } set { } } } + public partial class StartTranscriptionRequest + { + public StartTranscriptionRequest() { } + public string Locale { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + } + public partial class StopHoldMusicOptions + { + public StopHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { } + public string OperationContext { get { throw null; } set { } } + public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } + } + public partial class StopTranscriptionRequest + { + public StopTranscriptionRequest() { } + public string OperationContext { get { throw null; } set { } } + } public partial class TextSource : Azure.Communication.CallAutomation.PlaySource { public TextSource(string text) { } @@ -1372,6 +1402,11 @@ public partial class UnmuteParticipantsResult internal UnmuteParticipantsResult() { } public string OperationContext { get { throw null; } } } + public partial class UpdateTranscriptionDataRequest + { + public UpdateTranscriptionDataRequest(string locale) { } + public string Locale { get { throw null; } } + } public partial class UserConsent { internal UserConsent() { } From 97a11555e7d8bd35572731babbbf90243d3b9e9a Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Fri, 22 Sep 2023 14:54:04 -0700 Subject: [PATCH 06/10] Updating swagger --- .../src/CallMedia.cs | 8 +-- .../src/Generated/CallMediaRestClient.cs | 62 +++++++++---------- ...articipantRequestInternal.Serialization.cs | 35 ----------- .../Models/HoldParticipantRequestInternal.cs | 39 ------------ ...articipantRequestInternal.Serialization.cs | 28 --------- .../UnholdParticipantRequestInternal.cs | 38 ------------ .../Models/HoldParticipantRequestInternal.cs | 12 ---- .../UnholdParticipantRequestInternal.cs | 12 ---- .../src/autorest.md | 2 +- 9 files changed, 35 insertions(+), 201 deletions(-) delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs delete mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs index 31067b8393e9..7dfce91b7e04 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs @@ -405,7 +405,7 @@ public virtual Response StartHoldMusic(StartHoldMusicOptions options, Cancellati scope.Start(); try { - var request = new HoldParticipantRequestInternal( + var request = new StartHoldMusicRequestInternal( CommunicationIdentifierSerializer.Serialize(options.TargetParticipant), TranslatePlaySourceToInternal(options.PlaySourceInfo)) { @@ -434,7 +434,7 @@ public virtual async Task StartHoldMusicAsync(StartHoldMusicOptions op scope.Start(); try { - var request = new HoldParticipantRequestInternal( + var request = new StartHoldMusicRequestInternal( CommunicationIdentifierSerializer.Serialize(options.TargetParticipant), TranslatePlaySourceToInternal(options.PlaySourceInfo)) { @@ -463,7 +463,7 @@ public virtual async Task StopHoldMusicAsync(StopHoldMusicOptions opti scope.Start(); try { - UnholdParticipantRequestInternal request = new UnholdParticipantRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + StopHoldMusicRequestInternal request = new StopHoldMusicRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); return await CallMediaRestClient.StopHoldMusicAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -486,7 +486,7 @@ public virtual Response StopHoldMusic(StopHoldMusicOptions options, Cancellation scope.Start(); try { - UnholdParticipantRequestInternal request = new UnholdParticipantRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + StopHoldMusicRequestInternal request = new StopHoldMusicRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); return CallMediaRestClient.StopHoldMusic(CallConnectionId, request, cancellationToken: cancellationToken); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs index 30611d80f428..1cb5b08d7477 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs @@ -131,12 +131,11 @@ internal HttpMessage CreateStartTranscriptionRequest(string callConnectionId, St return message; } - /// Starts transcripition in the call. + /// Starts transcription in the call. /// The call connection id. /// The StartTranscriptionRequest to use. /// The cancellation token to use. /// or is null. - /// Starts transcription in the call. public async Task StartTranscriptionAsync(string callConnectionId, StartTranscriptionRequest startTranscriptionRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) @@ -159,12 +158,11 @@ public async Task StartTranscriptionAsync(string callConnectionId, Sta } } - /// Starts transcripition in the call. + /// Starts transcription in the call. /// The call connection id. /// The StartTranscriptionRequest to use. /// The cancellation token to use. /// or is null. - /// Starts transcription in the call. public Response StartTranscription(string callConnectionId, StartTranscriptionRequest startTranscriptionRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) @@ -693,7 +691,7 @@ public Response UpdateTranscriptionData(string callConnectionId, UpdateTranscrip } } - internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest) + internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -708,28 +706,28 @@ internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, HoldPa request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(holdParticipantRequest); + content.JsonWriter.WriteObjectValue(startHoldMusicRequest); request.Content = content; return message; } /// Hold participant from the call using identifier. /// The call connection id. - /// The participants to be hold from the call. + /// The participants to be hold from the call. /// The cancellation token to use. - /// or is null. - public async Task StartHoldMusicAsync(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest, CancellationToken cancellationToken = default) + /// or is null. + public async Task StartHoldMusicAsync(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (holdParticipantRequest == null) + if (startHoldMusicRequest == null) { - throw new ArgumentNullException(nameof(holdParticipantRequest)); + throw new ArgumentNullException(nameof(startHoldMusicRequest)); } - using var message = CreateStartHoldMusicRequest(callConnectionId, holdParticipantRequest); + using var message = CreateStartHoldMusicRequest(callConnectionId, startHoldMusicRequest); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -742,21 +740,21 @@ public async Task StartHoldMusicAsync(string callConnectionId, HoldPar /// Hold participant from the call using identifier. /// The call connection id. - /// The participants to be hold from the call. + /// The participants to be hold from the call. /// The cancellation token to use. - /// or is null. - public Response StartHoldMusic(string callConnectionId, HoldParticipantRequestInternal holdParticipantRequest, CancellationToken cancellationToken = default) + /// or is null. + public Response StartHoldMusic(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (holdParticipantRequest == null) + if (startHoldMusicRequest == null) { - throw new ArgumentNullException(nameof(holdParticipantRequest)); + throw new ArgumentNullException(nameof(startHoldMusicRequest)); } - using var message = CreateStartHoldMusicRequest(callConnectionId, holdParticipantRequest); + using var message = CreateStartHoldMusicRequest(callConnectionId, startHoldMusicRequest); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -767,7 +765,7 @@ public Response StartHoldMusic(string callConnectionId, HoldParticipantRequestIn } } - internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest) + internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -782,28 +780,28 @@ internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, UnholdP request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(unholdParticipantRequest); + content.JsonWriter.WriteObjectValue(stopHoldMusicRequest); request.Content = content; return message; } /// Unhold participants from the call using identifier. /// The call connection id. - /// The participants to be hold from the call. + /// The participants to be hold from the call. /// The cancellation token to use. - /// or is null. - public async Task StopHoldMusicAsync(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest, CancellationToken cancellationToken = default) + /// or is null. + public async Task StopHoldMusicAsync(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (unholdParticipantRequest == null) + if (stopHoldMusicRequest == null) { - throw new ArgumentNullException(nameof(unholdParticipantRequest)); + throw new ArgumentNullException(nameof(stopHoldMusicRequest)); } - using var message = CreateStopHoldMusicRequest(callConnectionId, unholdParticipantRequest); + using var message = CreateStopHoldMusicRequest(callConnectionId, stopHoldMusicRequest); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -816,21 +814,21 @@ public async Task StopHoldMusicAsync(string callConnectionId, UnholdPa /// Unhold participants from the call using identifier. /// The call connection id. - /// The participants to be hold from the call. + /// The participants to be hold from the call. /// The cancellation token to use. - /// or is null. - public Response StopHoldMusic(string callConnectionId, UnholdParticipantRequestInternal unholdParticipantRequest, CancellationToken cancellationToken = default) + /// or is null. + public Response StopHoldMusic(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (unholdParticipantRequest == null) + if (stopHoldMusicRequest == null) { - throw new ArgumentNullException(nameof(unholdParticipantRequest)); + throw new ArgumentNullException(nameof(stopHoldMusicRequest)); } - using var message = CreateStopHoldMusicRequest(callConnectionId, unholdParticipantRequest); + using var message = CreateStopHoldMusicRequest(callConnectionId, stopHoldMusicRequest); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs deleted file mode 100644 index 19c44be94025..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - internal partial class HoldParticipantRequestInternal : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("participantToHold"u8); - writer.WriteObjectValue(ParticipantToHold); - writer.WritePropertyName("playSourceInfo"u8); - writer.WriteObjectValue(PlaySourceInfo); - if (Optional.IsDefined(Loop)) - { - writer.WritePropertyName("loop"u8); - writer.WriteBooleanValue(Loop.Value); - } - if (Optional.IsDefined(OperationContext)) - { - writer.WritePropertyName("operationContext"u8); - writer.WriteStringValue(OperationContext); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs deleted file mode 100644 index 444bee9e528b..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldParticipantRequestInternal.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Communication; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - /// The request payload for holding participant from the call. - internal partial class HoldParticipantRequestInternal - { - /// Initializes a new instance of HoldParticipantRequestInternal. - /// Participant to be held from the call. - /// Prompt to play while in hold. - /// or is null. - public HoldParticipantRequestInternal(CommunicationIdentifierModel participantToHold, PlaySourceInternal playSourceInfo) - { - Argument.AssertNotNull(participantToHold, nameof(participantToHold)); - Argument.AssertNotNull(playSourceInfo, nameof(playSourceInfo)); - - ParticipantToHold = participantToHold; - PlaySourceInfo = playSourceInfo; - } - - /// Participant to be held from the call. - public CommunicationIdentifierModel ParticipantToHold { get; } - /// Prompt to play while in hold. - public PlaySourceInternal PlaySourceInfo { get; } - /// If the prompt will be looped or not. - public bool? Loop { get; set; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs deleted file mode 100644 index b2aff6c9aca8..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - internal partial class UnholdParticipantRequestInternal : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("participantToUnhold"u8); - writer.WriteObjectValue(ParticipantToUnhold); - if (Optional.IsDefined(OperationContext)) - { - writer.WritePropertyName("operationContext"u8); - writer.WriteStringValue(OperationContext); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs deleted file mode 100644 index 8ad0ab8bafa9..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UnholdParticipantRequestInternal.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Communication; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - /// The request payload for holding participant from the call. - internal partial class UnholdParticipantRequestInternal - { - /// Initializes a new instance of UnholdParticipantRequestInternal. - /// - /// Participants to be hold from the call. - /// Only ACS Users are supported. - /// - /// is null. - public UnholdParticipantRequestInternal(CommunicationIdentifierModel participantToUnhold) - { - Argument.AssertNotNull(participantToUnhold, nameof(participantToUnhold)); - - ParticipantToUnhold = participantToUnhold; - } - - /// - /// Participants to be hold from the call. - /// Only ACS Users are supported. - /// - public CommunicationIdentifierModel ParticipantToUnhold { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs deleted file mode 100644 index 6b9b99779d8f..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldParticipantRequestInternal.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - [CodeGenModel("HoldParticipantRequest")] - internal partial class HoldParticipantRequestInternal - { - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs deleted file mode 100644 index 6020f3432910..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UnholdParticipantRequestInternal.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - [CodeGenModel("UnholdParticipantRequest")] - internal partial class UnholdParticipantRequestInternal - { - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index 59dccc362352..3934daf6bfaf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -10,7 +10,7 @@ model-namespace: false tag: package-2023-01-15-preview require: - - https://github.com/cochi2/azure-rest-api-specs/blob/165e9bcec8bcd7d2085df5fa0cd6a7e8f587caa1/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/cochi2/azure-rest-api-specs/blob/7b68c79edf66b710e8979d9ae1d409add1dd4f38/specification/communication/data-plane/CallAutomation/readme.md title: Azure Communication Services From 09da42637c65e62066449650106488722ea465e4 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Fri, 22 Sep 2023 15:07:10 -0700 Subject: [PATCH 07/10] Adding missing files --- ...tHoldMusicRequestInternal.Serialization.cs | 35 +++++++++++++++++ .../Models/StartHoldMusicRequestInternal.cs | 39 +++++++++++++++++++ ...pHoldMusicRequestInternal.Serialization.cs | 28 +++++++++++++ .../Models/StopHoldMusicRequestInternal.cs | 38 ++++++++++++++++++ .../Models/StartHoldMusicRequestInternal.cs | 12 ++++++ .../Models/StopHoldMusicRequestInternal.cs | 12 ++++++ 6 files changed, 164 insertions(+) create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicRequestInternal.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicRequestInternal.cs diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs new file mode 100644 index 000000000000..e4103773fc86 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + internal partial class StartHoldMusicRequestInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("targetParticipant"u8); + writer.WriteObjectValue(TargetParticipant); + writer.WritePropertyName("playSourceInfo"u8); + writer.WriteObjectValue(PlaySourceInfo); + if (Optional.IsDefined(Loop)) + { + writer.WritePropertyName("loop"u8); + writer.WriteBooleanValue(Loop.Value); + } + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs new file mode 100644 index 000000000000..2332bb6c1ce1 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Communication; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The request payload for holding participant from the call. + internal partial class StartHoldMusicRequestInternal + { + /// Initializes a new instance of StartHoldMusicRequestInternal. + /// Participant to be held from the call. + /// Prompt to play while in hold. + /// or is null. + public StartHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant, PlaySourceInternal playSourceInfo) + { + Argument.AssertNotNull(targetParticipant, nameof(targetParticipant)); + Argument.AssertNotNull(playSourceInfo, nameof(playSourceInfo)); + + TargetParticipant = targetParticipant; + PlaySourceInfo = playSourceInfo; + } + + /// Participant to be held from the call. + public CommunicationIdentifierModel TargetParticipant { get; } + /// Prompt to play while in hold. + public PlaySourceInternal PlaySourceInfo { get; } + /// If the prompt will be looped or not. + public bool? Loop { get; set; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs new file mode 100644 index 000000000000..c2b1c0006903 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + internal partial class StopHoldMusicRequestInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("targetParticipant"u8); + writer.WriteObjectValue(TargetParticipant); + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs new file mode 100644 index 000000000000..c70bfc183680 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Communication; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The request payload for holding participant from the call. + internal partial class StopHoldMusicRequestInternal + { + /// Initializes a new instance of StopHoldMusicRequestInternal. + /// + /// Participants to be hold from the call. + /// Only ACS Users are supported. + /// + /// is null. + public StopHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant) + { + Argument.AssertNotNull(targetParticipant, nameof(targetParticipant)); + + TargetParticipant = targetParticipant; + } + + /// + /// Participants to be hold from the call. + /// Only ACS Users are supported. + /// + public CommunicationIdentifierModel TargetParticipant { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicRequestInternal.cs new file mode 100644 index 000000000000..2f398fb6831d --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicRequestInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("StartHoldMusicRequest")] + internal partial class StartHoldMusicRequestInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicRequestInternal.cs new file mode 100644 index 000000000000..5e2e53f3a70e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicRequestInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("StopHoldMusicRequest")] + internal partial class StopHoldMusicRequestInternal + { + } +} From 7eb8695271de04a23d8d26408abb83b273fa3c37 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Fri, 22 Sep 2023 15:12:11 -0700 Subject: [PATCH 08/10] Updating docstring --- .../src/CallMedia.cs | 4 ++-- .../src/Models/StartHoldMusicOptions.cs | 16 +++++++--------- .../src/Models/StopHoldMusicOptions.cs | 8 +++----- .../tests/CallMedias/CallMediaTests.cs | 4 +--- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs index 7dfce91b7e04..8355bed4a967 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs @@ -394,7 +394,7 @@ public virtual Response StartRecognizing(CallMe } /// - /// Hold participant. + /// Hold participant from the call. /// /// The options. /// @@ -423,7 +423,7 @@ public virtual Response StartHoldMusic(StartHoldMusicOptions options, Cancellati } /// - /// Hold participant. + /// Hold participant from the call. /// /// The options. /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs index 627df986857e..3caef136ee80 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartHoldMusicOptions.cs @@ -1,32 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.Collections.Generic; -using System.Linq; - namespace Azure.Communication.CallAutomation { /// - /// Options for the Unmute Participant Request. + /// Options for the Start Hold Music Request. /// public class StartHoldMusicOptions { /// - /// Creates a new UnmuteParticipantOptions object. + /// Creates a new StartHoldMusicOptions object. /// - public StartHoldMusicOptions(CommunicationIdentifier targetParticipant) + public StartHoldMusicOptions(CommunicationIdentifier targetParticipant, PlaySource playSourceInfo) { TargetParticipant = targetParticipant; + PlaySourceInfo = playSourceInfo; + Loop = true; } /// - /// The identity of participants to be held from the call. + /// The participant that is going to be put on hold. /// public CommunicationIdentifier TargetParticipant { get; } /// - /// Prompt to play while in hold. + /// Prompt to play while on hold. /// public PlaySource PlaySourceInfo { get; set; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs index 24fd27679fe8..bdcd88688c4f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopHoldMusicOptions.cs @@ -4,12 +4,12 @@ namespace Azure.Communication.CallAutomation { /// - /// Options for the Unmute Participant Request. + /// Options for the Stop Hold Music Request. /// public class StopHoldMusicOptions { /// - /// Creates a new UnmuteParticipantOptions object. + /// Creates a new StopHoldMusicOptions object. /// public StopHoldMusicOptions(CommunicationIdentifier targetParticipant) { @@ -17,9 +17,7 @@ public StopHoldMusicOptions(CommunicationIdentifier targetParticipant) } /// - /// The identity of participants to be unmuted from the call. - /// Only one participant is currently supported. - /// Only ACS Users are currently supported. + /// The participant that is currently on hold. /// public CommunicationIdentifier TargetParticipant { get; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs index ac78adb82efb..016f0d8118e0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs @@ -141,10 +141,8 @@ public class CallMediaTests : CallAutomationTestBase private static readonly CallMediaRecognizeOptions _emptyRecognizeOptions = new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier("targetUserId"), maxTonesToCollect: 1); - private static readonly StartHoldMusicOptions _startHoldMusicOptions = new StartHoldMusicOptions(new CommunicationUserIdentifier("targetUserId")) + private static readonly StartHoldMusicOptions _startHoldMusicOptions = new StartHoldMusicOptions(new CommunicationUserIdentifier("targetUserId"), _textSource) { - PlaySourceInfo = _textSource, - Loop = true, OperationContext = "operationContext" }; From 38a6c32ec32b7bbeaacf26307aa41e217e2e2081 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Mon, 25 Sep 2023 09:48:59 -0700 Subject: [PATCH 09/10] Export API --- .../api/Azure.Communication.CallAutomation.netstandard2.0.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs index 17a63a98b593..abf6e3d08cfd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs @@ -1277,7 +1277,7 @@ public StartDialogOptions(string dialogId, Azure.Communication.CallAutomation.Di } public partial class StartHoldMusicOptions { - public StartHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { } + public StartHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetParticipant, Azure.Communication.CallAutomation.PlaySource playSourceInfo) { } public bool Loop { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } From 1670e695677a30a7081c06ec23b4b10dfd0f8506 Mon Sep 17 00:00:00 2001 From: Franko Morales Date: Mon, 25 Sep 2023 10:04:11 -0700 Subject: [PATCH 10/10] Updating swagger location --- .../Azure.Communication.CallAutomation/src/autorest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index 3934daf6bfaf..63aa64e69eda 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -10,7 +10,7 @@ model-namespace: false tag: package-2023-01-15-preview require: - - https://github.com/cochi2/azure-rest-api-specs/blob/7b68c79edf66b710e8979d9ae1d409add1dd4f38/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/williamzhao87/azure-rest-api-specs/blob/8f5bd72f81f7fa9020f6834f06f3db54a475ee68/specification/communication/data-plane/CallAutomation/readme.md title: Azure Communication Services