diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java index 9d6a537a478da..a34214f896b18 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java @@ -5,9 +5,9 @@ import com.azure.communication.callautomation.implementation.AzureCommunicationCallAutomationServiceImpl; import com.azure.communication.callautomation.implementation.CallConnectionsImpl; +import com.azure.communication.callautomation.implementation.CallDialogsImpl; import com.azure.communication.callautomation.implementation.CallMediasImpl; import com.azure.communication.callautomation.implementation.CallRecordingsImpl; -import com.azure.communication.callautomation.implementation.CallDialogsImpl; import com.azure.communication.callautomation.implementation.accesshelpers.CallConnectionPropertiesConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; import com.azure.communication.callautomation.implementation.converters.CommunicationUserIdentifierConverter; @@ -15,16 +15,18 @@ import com.azure.communication.callautomation.implementation.models.AnswerCallRequestInternal; import com.azure.communication.callautomation.implementation.models.CallIntelligenceOptionsInternal; import com.azure.communication.callautomation.implementation.models.CallRejectReasonInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingAudioChannelTypeInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingConfigurationInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingContentTypeInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingTransportTypeInternal; import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; import com.azure.communication.callautomation.implementation.models.CommunicationUserIdentifierModel; import com.azure.communication.callautomation.implementation.models.CreateCallRequestInternal; import com.azure.communication.callautomation.implementation.models.CustomCallingContext; +import com.azure.communication.callautomation.implementation.models.MediaStreamingAudioChannelTypeInternal; +import com.azure.communication.callautomation.implementation.models.MediaStreamingConfigurationInternal; +import com.azure.communication.callautomation.implementation.models.MediaStreamingContentTypeInternal; +import com.azure.communication.callautomation.implementation.models.MediaStreamingTransportTypeInternal; import com.azure.communication.callautomation.implementation.models.RedirectCallRequestInternal; import com.azure.communication.callautomation.implementation.models.RejectCallRequestInternal; +import com.azure.communication.callautomation.implementation.models.TranscriptionConfigurationInternal; +import com.azure.communication.callautomation.implementation.models.TranscriptionTransportTypeInternal; import com.azure.communication.callautomation.models.AnswerCallOptions; import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallInvite; @@ -34,6 +36,7 @@ import com.azure.communication.callautomation.models.MediaStreamingOptions; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; +import com.azure.communication.callautomation.models.TranscriptionOptions; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.annotation.ReturnType; @@ -49,8 +52,10 @@ import reactor.core.publisher.Mono; import java.net.URISyntaxException; +import java.time.OffsetDateTime; import java.util.LinkedList; import java.util.List; +import java.util.UUID; import java.util.stream.Collectors; import static com.azure.core.util.FluxUtil.monoError; @@ -181,6 +186,8 @@ private Mono> getCreateCallResponseMono(Context conte context = context == null ? Context.NONE : context; return azureCommunicationCallAutomationServiceInternal.createCallWithResponseAsync( createCallRequestInternal, + UUID.randomUUID(), + OffsetDateTime.now(), context) .map(response -> { try { @@ -231,6 +238,12 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions request.setMediaStreamingConfiguration(streamingConfigurationInternal); } + if (createCallOptions.getTranscriptionConfiguration() != null) { + TranscriptionConfigurationInternal transcriptionConfigurationInternal = + getTranscriptionConfigurationInternal(createCallOptions.getTranscriptionConfiguration()); + request.setTranscriptionConfiguration(transcriptionConfigurationInternal); + } + return request; } @@ -266,6 +279,12 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp request.setMediaStreamingConfiguration(streamingConfigurationInternal); } + if (createCallGroupOptions.getTranscriptionConfiguration() != null) { + TranscriptionConfigurationInternal transcriptionConfigurationInternal = + getTranscriptionConfigurationInternal(createCallGroupOptions.getTranscriptionConfiguration()); + request.setTranscriptionConfiguration(transcriptionConfigurationInternal); + } + return request; } @@ -284,6 +303,17 @@ private MediaStreamingConfigurationInternal getMediaStreamingConfigurationIntern mediaStreamingOptions.getTransportType().toString())); } + private TranscriptionConfigurationInternal getTranscriptionConfigurationInternal( + TranscriptionOptions transcriptionOptions) { + return new TranscriptionConfigurationInternal() + .setTransportUrl(transcriptionOptions.getTransportUrl()) + .setTransportType( + TranscriptionTransportTypeInternal.fromString( + transcriptionOptions.getTransportType().toString())) + .setLocale(transcriptionOptions.getLocale()) + .setStartTranscription(transcriptionOptions.getStartTranscription()); + } + /** * Answer an incoming call * @@ -332,11 +362,19 @@ Mono> answerCallWithResponseInternal(AnswerCallOption if (answerCallOptions.getMediaStreamingConfiguration() != null) { MediaStreamingConfigurationInternal mediaStreamingConfigurationInternal = getMediaStreamingConfigurationInternal(answerCallOptions.getMediaStreamingConfiguration()); - request.setMediaStreamingConfiguration(mediaStreamingConfigurationInternal); } + + if (answerCallOptions.getTranscriptionConfiguration() != null) { + TranscriptionConfigurationInternal transcriptionConfigurationInternal = + getTranscriptionConfigurationInternal(answerCallOptions.getTranscriptionConfiguration()); + request.setTranscriptionConfiguration(transcriptionConfigurationInternal); + } + return azureCommunicationCallAutomationServiceInternal.answerCallWithResponseAsync( request, + UUID.randomUUID(), + OffsetDateTime.now(), context) .map(response -> { try { @@ -401,6 +439,8 @@ Mono> redirectCallWithResponseInternal(RedirectCallOptions redire return azureCommunicationCallAutomationServiceInternal.redirectCallWithResponseAsync( request, + UUID.randomUUID(), + OffsetDateTime.now(), context); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -446,6 +486,8 @@ Mono> rejectCallWithResponseInternal(RejectCallOptions rejectCall return azureCommunicationCallAutomationServiceInternal.rejectCallWithResponseAsync( request, + UUID.randomUUID(), + OffsetDateTime.now(), context); } catch (RuntimeException ex) { return monoError(logger, ex); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java index 8ccb22bcc1236..75d82a176235d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java @@ -33,8 +33,13 @@ import com.azure.communication.callautomation.models.events.RecordingStateChanged; import com.azure.communication.callautomation.models.events.RemoveParticipantFailed; import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; +import com.azure.communication.callautomation.models.events.TranscriptionFailed; +import com.azure.communication.callautomation.models.events.TranscriptionResumed; +import com.azure.communication.callautomation.models.events.TranscriptionStarted; +import com.azure.communication.callautomation.models.events.TranscriptionStopped; import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; +import com.azure.communication.callautomation.models.events.TranscriptionUpdated; import com.azure.core.models.CloudEvent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.core.JsonProcessingException; @@ -160,6 +165,16 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String ret = mapper.convertValue(eventData, DialogTransfer.class); } else if (Objects.equals(eventType, "Microsoft.Communication.DialogSensitivityUpdate")) { ret = mapper.convertValue(eventData, DialogSensitivityUpdate.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionStarted")) { + ret = mapper.convertValue(eventData, TranscriptionStarted.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionFailed")) { + ret = mapper.convertValue(eventData, TranscriptionFailed.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionResumed")) { + ret = mapper.convertValue(eventData, TranscriptionResumed.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionStopped")) { + ret = mapper.convertValue(eventData, TranscriptionStopped.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionUpdated")) { + ret = mapper.convertValue(eventData, TranscriptionUpdated.class); } return ret; } catch (RuntimeException e) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnectionAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnectionAsync.java index c182dfe9f1c20..44ad8c818db7b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnectionAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnectionAsync.java @@ -23,13 +23,13 @@ import com.azure.communication.callautomation.implementation.models.RemoveParticipantRequestInternal; import com.azure.communication.callautomation.implementation.models.TransferToParticipantRequestInternal; import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsRequestInternal; +import com.azure.communication.callautomation.models.AddParticipantOptions; import com.azure.communication.callautomation.models.AddParticipantResult; +import com.azure.communication.callautomation.models.CallConnectionProperties; +import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallParticipant; import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; -import com.azure.communication.callautomation.models.AddParticipantOptions; -import com.azure.communication.callautomation.models.CallConnectionProperties; -import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.MuteParticipantOptions; import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; @@ -44,6 +44,7 @@ import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; @@ -51,10 +52,11 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import reactor.core.publisher.Mono; -import com.azure.core.exception.HttpResponseException; import java.net.URISyntaxException; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.UUID; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; @@ -156,6 +158,8 @@ Mono> hangUpWithResponseInternal(boolean isForEveryone, Context c return (isForEveryone ? callConnectionInternal.terminateCallWithResponseAsync( callConnectionId, + UUID.randomUUID(), + OffsetDateTime.now(), context) : callConnectionInternal.hangupCallWithResponseAsync(callConnectionId, context)); } catch (RuntimeException ex) { @@ -292,6 +296,8 @@ Mono> transferCallToParticipantWithResponseInternal return callConnectionInternal.transferToParticipantWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context) .map(response -> { TransferCallResult result = TransferCallResponseConstructorProxy.create(response.getValue()); @@ -355,6 +361,8 @@ Mono> addParticipantWithResponseInternal(AddParti return callConnectionInternal.addParticipantWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context ).map(response -> { AddParticipantResult result = AddParticipantResponseConstructorProxy.create(response.getValue()); @@ -404,6 +412,8 @@ Mono> removeParticipantWithResponseInternal(Re return callConnectionInternal.removeParticipantWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context).map(response -> { RemoveParticipantResult result = RemoveParticipantResponseConstructorProxy.create(response.getValue()); result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); @@ -449,6 +459,8 @@ Mono> muteParticipantWithResponseInternal(MutePa return callConnectionInternal.muteWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context).map(internalResponse -> new SimpleResponse<>(internalResponse, MuteParticipantsResponseConstructorProxy.create(internalResponse.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -488,6 +500,8 @@ Mono> unmuteParticipantWithResponseInternal(Un return callConnectionInternal.unmuteWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context).map(internalResponse -> new SimpleResponse<>(internalResponse, UnmuteParticipantsResponseConstructorProxy.create(internalResponse.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -532,6 +546,8 @@ Mono> cancelAddParticipantOperatio return callConnectionInternal.cancelAddParticipantWithResponseAsync( callConnectionId, request, + UUID.randomUUID(), + OffsetDateTime.now(), context).map(response -> { CancelAddParticipantOperationResult result = CancelAddParticipantResponseConstructorProxy.create(response.getValue()); result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMedia.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMedia.java index 7056a9f9a5816..9fed8d918493f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMedia.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMedia.java @@ -11,6 +11,8 @@ import com.azure.communication.callautomation.models.SendDtmfTonesOptions; import com.azure.communication.callautomation.models.SendDtmfTonesResult; import com.azure.communication.callautomation.models.StartHoldMusicOptions; +import com.azure.communication.callautomation.models.StartTranscriptionOptions; +import com.azure.communication.callautomation.models.StopTranscriptionOptions; import com.azure.communication.callautomation.models.PlaySource; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; @@ -263,4 +265,65 @@ public Response stopHoldMusicWithResponse(CommunicationIdentifier targetPa Context context) { return callMediaAsync.stopHoldMusicWithResponseInternal(targetParticipant, operationContext, context).block(); } + + /** + * Starts transcription in the call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void startTranscription() { + callMediaAsync.startTranscription().block(); + } + + /** + * Starts transcription in the call. + * + * @param options Options for the Start Transcription operation. + * @param context Context + * @return Response for successful start transcription request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startTranscriptionWithResponse(StartTranscriptionOptions options, Context context) { + return callMediaAsync.startTranscriptionWithResponseInternal(options, context).block(); + } + + /** + * Stops transcription in the call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopTranscription() { + callMediaAsync.stopTranscription().block(); + } + + /** + * Stops transcription in the call. + * + * @param options Options for the Stop Transcription operation. + * @param context Context + * @return Response for successful stop transcription request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopTranscriptionWithResponse(StopTranscriptionOptions options, Context context) { + return callMediaAsync.stopTranscriptionWithResponseInternal(options, context).block(); + } + + /** + * Updates transcription language in the call. + * @param locale Defines new locale for transcription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateTranscription(String locale) { + callMediaAsync.updateTranscription(locale).block(); + } + + /** + * Updates transcription language in the call. + * + * @param locale Defines new locale for transcription. + * @param context Context + * @return Response for successful update transcription request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTranscriptionWithResponse(String locale, Context context) { + return callMediaAsync.updateTranscriptionWithResponseInternal(locale, context).block(); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java index bf6c5ebdd0c3b..47e5c84a95fae 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java @@ -22,8 +22,11 @@ import com.azure.communication.callautomation.implementation.models.SpeechOptionsInternal; import com.azure.communication.callautomation.implementation.models.SsmlSourceInternal; import com.azure.communication.callautomation.implementation.models.StartHoldMusicRequestInternal; +import com.azure.communication.callautomation.implementation.models.StartTranscriptionRequestInternal; import com.azure.communication.callautomation.implementation.models.StopHoldMusicRequestInternal; +import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequestInternal; import com.azure.communication.callautomation.implementation.models.TextSourceInternal; +import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequestInternal; import com.azure.communication.callautomation.implementation.models.VoiceKindInternal; import com.azure.communication.callautomation.models.CallMediaRecognizeChoiceOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeDtmfOptions; @@ -41,6 +44,8 @@ import com.azure.communication.callautomation.models.SendDtmfTonesResult; import com.azure.communication.callautomation.models.SsmlSource; import com.azure.communication.callautomation.models.StartHoldMusicOptions; +import com.azure.communication.callautomation.models.StartTranscriptionOptions; +import com.azure.communication.callautomation.models.StopTranscriptionOptions; import com.azure.communication.callautomation.models.TextSource; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; @@ -54,9 +59,11 @@ import reactor.core.publisher.Mono; import java.time.Duration; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.stream.Collectors; import static com.azure.core.util.FluxUtil.monoError; @@ -576,6 +583,8 @@ Mono> sendDtmfTonesWithResponseInternal(SendDtmfTo return contentsInternal.sendDtmfTonesWithResponseAsync( callConnectionId, requestInternal, + UUID.randomUUID(), + OffsetDateTime.now(), context ).map(response -> new SimpleResponse<>(response, SendDtmfTonesResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException e) { @@ -725,4 +734,100 @@ Mono> stopHoldMusicWithResponseInternal(CommunicationIdentifier t return monoError(logger, ex); } } + + /** + * Starts transcription in the call. + * + * @return Response for successful operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startTranscription() { + return startTranscriptionWithResponseAsync(null).then(); + } + + /** + * Starts transcription in the call with options. + * + * @param options Options for the Start Transcription operation. + * @return Response for successful operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> startTranscriptionWithResponseAsync(StartTranscriptionOptions options) { + return withContext(context -> startTranscriptionWithResponseInternal(options, context)); + } + + Mono> startTranscriptionWithResponseInternal(StartTranscriptionOptions options, Context context) { + try { + context = context == null ? Context.NONE : context; + StartTranscriptionRequestInternal request = new StartTranscriptionRequestInternal(); + if (options != null) { + request.setLocale(options.getLocale()); + request.setOperationContext(options.getOperationContext()); + } + return contentsInternal + .startTranscriptionWithResponseAsync(callConnectionId, request, context); + } catch (RuntimeException ex) { + return monoError(logger, ex); + } + } + + /** + * Stops transcription in the call. + * + * @return Response for successful operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopTranscription() { + return stopTranscriptionWithResponseAsync(null).then(); + } + + /** + * Stops transcription in the call with options. + * + * @param options Options for the Stop Transcription operation. + * @return Response for successful operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTranscriptionWithResponseAsync(StopTranscriptionOptions options) { + return withContext(context -> stopTranscriptionWithResponseInternal(options, context)); + } + + Mono> stopTranscriptionWithResponseInternal(StopTranscriptionOptions options, Context context) { + try { + context = context == null ? Context.NONE : context; + StopTranscriptionRequestInternal request = new StopTranscriptionRequestInternal(); + if (options != null) { + request.setOperationContext(options.getOperationContext()); + } + return contentsInternal + .stopTranscriptionWithResponseAsync(callConnectionId, request, context); + } catch (RuntimeException ex) { + return monoError(logger, ex); + } + } + + /** + * Updates transcription language + * + * @param locale Defines new locale for transcription. + * @return Response for successful operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateTranscription(String locale) { + return withContext(context -> updateTranscriptionWithResponseInternal(locale, context)).then(); + } + + Mono> updateTranscriptionWithResponseInternal(String locale, Context context) { + try { + context = context == null ? Context.NONE : context; + UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(); + request.setLocale(locale); + return contentsInternal + .updateTranscriptionWithResponseAsync(callConnectionId, request, context); + } catch (RuntimeException ex) { + return monoError(logger, ex); + } + } + + } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java index 8d4e5534cab57..897c6518eea20 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java @@ -12,9 +12,9 @@ import com.azure.communication.callautomation.implementation.models.ChannelAffinityInternal; import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; import com.azure.communication.callautomation.implementation.models.ExternalStorageInternal; +import com.azure.communication.callautomation.implementation.models.RecordingChannelInternal; import com.azure.communication.callautomation.implementation.models.RecordingContentInternal; import com.azure.communication.callautomation.implementation.models.RecordingFormatInternal; -import com.azure.communication.callautomation.implementation.models.RecordingChannelInternal; import com.azure.communication.callautomation.implementation.models.RecordingStorageTypeInternal; import com.azure.communication.callautomation.implementation.models.StartCallRecordingRequestInternal; import com.azure.communication.callautomation.models.BlobStorage; @@ -29,6 +29,7 @@ import com.azure.communication.callautomation.models.StartRecordingOptions; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpRange; @@ -51,15 +52,16 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.security.InvalidParameterException; +import java.time.OffsetDateTime; import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; +import java.util.UUID; import java.util.stream.Collectors; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; -import com.azure.core.exception.HttpResponseException; /** * CallRecordingAsync. @@ -120,6 +122,8 @@ Mono> startWithResponseInternal(StartRecordingOpt return callRecordingsInternal .startRecordingWithResponseAsync( request, + UUID.randomUUID(), + OffsetDateTime.now(), contextValue) .map(response -> new SimpleResponse<>(response, RecordingStateResponseConstructorProxy.create(response.getValue())) diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImpl.java index 73ecfe7f45b2d..451c612f96621 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImpl.java @@ -23,6 +23,7 @@ import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.http.rest.Response; @@ -36,121 +37,101 @@ import java.util.UUID; import reactor.core.publisher.Mono; -/** - * Initializes a new instance of the AzureCommunicationCallAutomationService type. - */ +/** Initializes a new instance of the AzureCommunicationCallAutomationService type. */ public final class AzureCommunicationCallAutomationServiceImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final AzureCommunicationCallAutomationServiceService service; - /** - * The endpoint of the Azure Communication resource. - */ + /** The endpoint of the Azure Communication resource. */ private final String endpoint; /** * Gets The endpoint of the Azure Communication resource. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** - * Api Version. - */ + /** Api Version. */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** - * The HTTP pipeline to send requests through. - */ + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** - * The serializer to serialize an object into a string. - */ + /** The serializer to serialize an object into a string. */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** - * The CallConnectionsImpl object to access its operations. - */ + /** The CallConnectionsImpl object to access its operations. */ private final CallConnectionsImpl callConnections; /** * Gets the CallConnectionsImpl object to access its operations. - * + * * @return the CallConnectionsImpl object. */ public CallConnectionsImpl getCallConnections() { return this.callConnections; } - /** - * The CallMediasImpl object to access its operations. - */ + /** The CallMediasImpl object to access its operations. */ private final CallMediasImpl callMedias; /** * Gets the CallMediasImpl object to access its operations. - * + * * @return the CallMediasImpl object. */ public CallMediasImpl getCallMedias() { return this.callMedias; } - /** - * The CallDialogsImpl object to access its operations. - */ + /** The CallDialogsImpl object to access its operations. */ private final CallDialogsImpl callDialogs; /** * Gets the CallDialogsImpl object to access its operations. - * + * * @return the CallDialogsImpl object. */ public CallDialogsImpl getCallDialogs() { return this.callDialogs; } - /** - * The CallRecordingsImpl object to access its operations. - */ + /** The CallRecordingsImpl object to access its operations. */ private final CallRecordingsImpl callRecordings; /** * Gets the CallRecordingsImpl object to access its operations. - * + * * @return the CallRecordingsImpl object. */ public CallRecordingsImpl getCallRecordings() { @@ -159,18 +140,23 @@ public CallRecordingsImpl getCallRecordings() { /** * Initializes an instance of AzureCommunicationCallAutomationService client. - * + * * @param endpoint The endpoint of the Azure Communication resource. * @param apiVersion Api Version. */ AzureCommunicationCallAutomationServiceImpl(String endpoint, String apiVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + apiVersion); } /** * Initializes an instance of AzureCommunicationCallAutomationService client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint of the Azure Communication resource. * @param apiVersion Api Version. @@ -181,14 +167,14 @@ public CallRecordingsImpl getCallRecordings() { /** * Initializes an instance of AzureCommunicationCallAutomationService client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint of the Azure Communication resource. * @param apiVersion Api Version. */ - AzureCommunicationCallAutomationServiceImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String apiVersion) { + AzureCommunicationCallAutomationServiceImpl( + HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; @@ -197,8 +183,11 @@ public CallRecordingsImpl getCallRecordings() { this.callMedias = new CallMediasImpl(this); this.callDialogs = new CallDialogsImpl(this); this.callRecordings = new CallRecordingsImpl(this); - this.service = RestProxy.create(AzureCommunicationCallAutomationServiceService.class, this.httpPipeline, - this.getSerializerAdapter()); + this.service = + RestProxy.create( + AzureCommunicationCallAutomationServiceService.class, + this.httpPipeline, + this.getSerializerAdapter()); } /** @@ -209,443 +198,803 @@ public CallRecordingsImpl getCallRecordings() { @ServiceInterface(name = "AzureCommunicationCa") public interface AzureCommunicationCallAutomationServiceService { @Post("/calling/callConnections") - @ExpectedResponses({ 201 }) + @ExpectedResponses({201}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> createCall(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CreateCallRequestInternal createCallRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> createCall( + @HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") CreateCallRequestInternal createCallRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections:answer") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> answerCall(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AnswerCallRequestInternal answerCallRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> answerCall( + @HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") AnswerCallRequestInternal answerCallRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections:redirect") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> redirectCall(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RedirectCallRequestInternal redirectCallRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> redirectCall( + @HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") RedirectCallRequestInternal redirectCallRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections:reject") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> rejectCall(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RejectCallRequestInternal rejectCallRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> rejectCall( + @HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") RejectCallRequestInternal rejectCallRequest, + @HeaderParam("Accept") String accept, + Context context); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - createCallWithResponseAsync(CreateCallRequestInternal createCallRequest) { + public Mono> createCallWithResponseAsync( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.createCall(this.getEndpoint(), this.getApiVersion(), - createCallRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.createCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + createCallRequest, + accept, + context)); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - createCallWithResponseAsync(CreateCallRequestInternal createCallRequest, Context context) { + public Mono> createCallWithResponseAsync( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.createCall(this.getEndpoint(), this.getApiVersion(), createCallRequest, accept, - repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.createCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + createCallRequest, + accept, + context); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createCallAsync(CreateCallRequestInternal createCallRequest) { - return createCallWithResponseAsync(createCallRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono createCallAsync( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return createCallWithResponseAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createCallAsync(CreateCallRequestInternal createCallRequest, - Context context) { - return createCallWithResponseAsync(createCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono createCallAsync( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return createCallWithResponseAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - createCallWithResponse(CreateCallRequestInternal createCallRequest, Context context) { - return createCallWithResponseAsync(createCallRequest, context).block(); + public CallConnectionPropertiesInternal createCall( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return createCallAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** * Create an outbound call. - * + * * @param createCallRequest The create call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal createCall(CreateCallRequestInternal createCallRequest) { - return createCallWithResponse(createCallRequest, Context.NONE).getValue(); + public Response createCallWithResponse( + CreateCallRequestInternal createCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return createCallWithResponseAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - answerCallWithResponseAsync(AnswerCallRequestInternal answerCallRequest) { + public Mono> answerCallWithResponseAsync( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.answerCall(this.getEndpoint(), this.getApiVersion(), - answerCallRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.answerCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + answerCallRequest, + accept, + context)); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - answerCallWithResponseAsync(AnswerCallRequestInternal answerCallRequest, Context context) { + public Mono> answerCallWithResponseAsync( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.answerCall(this.getEndpoint(), this.getApiVersion(), answerCallRequest, accept, - repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.answerCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + answerCallRequest, + accept, + context); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono answerCallAsync(AnswerCallRequestInternal answerCallRequest) { - return answerCallWithResponseAsync(answerCallRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono answerCallAsync( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection on successful completion of {@link Mono}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono answerCallAsync(AnswerCallRequestInternal answerCallRequest, - Context context) { - return answerCallWithResponseAsync(answerCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono answerCallAsync( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a call connection along with {@link Response}. + * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - answerCallWithResponse(AnswerCallRequestInternal answerCallRequest, Context context) { - return answerCallWithResponseAsync(answerCallRequest, context).block(); + public CallConnectionPropertiesInternal answerCall( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return answerCallAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** - * Answer a Call. - * * Answer a call using the IncomingCallContext from Event Grid. - * + * * @param answerCallRequest The answer call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a call connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal answerCall(AnswerCallRequestInternal answerCallRequest) { - return answerCallWithResponse(answerCallRequest, Context.NONE).getValue(); + public Response answerCallWithResponse( + AnswerCallRequestInternal answerCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> redirectCallWithResponseAsync(RedirectCallRequestInternal redirectCallRequest) { + public Mono> redirectCallWithResponseAsync( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.redirectCall(this.getEndpoint(), this.getApiVersion(), - redirectCallRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.redirectCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + redirectCallRequest, + accept, + context)); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> redirectCallWithResponseAsync(RedirectCallRequestInternal redirectCallRequest, - Context context) { + public Mono> redirectCallWithResponseAsync( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.redirectCall(this.getEndpoint(), this.getApiVersion(), redirectCallRequest, accept, - repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.redirectCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + redirectCallRequest, + accept, + context); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest) { - return redirectCallWithResponseAsync(redirectCallRequest).flatMap(ignored -> Mono.empty()); + public Mono redirectCallAsync( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return redirectCallWithResponseAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap((Response res) -> Mono.empty()); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest, Context context) { - return redirectCallWithResponseAsync(redirectCallRequest, context).flatMap(ignored -> Mono.empty()); + public Mono redirectCallAsync( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return redirectCallWithResponseAsync( + redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap((Response res) -> Mono.empty()); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response redirectCallWithResponse(RedirectCallRequestInternal redirectCallRequest, Context context) { - return redirectCallWithResponseAsync(redirectCallRequest, context).block(); + public void redirectCall( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + redirectCallAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** * Redirect a call. - * + * * @param redirectCallRequest The redirect call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redirectCall(RedirectCallRequestInternal redirectCallRequest) { - redirectCallWithResponse(redirectCallRequest, Context.NONE); + public Response redirectCallWithResponse( + RedirectCallRequestInternal redirectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return redirectCallWithResponseAsync( + redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rejectCallWithResponseAsync(RejectCallRequestInternal rejectCallRequest) { + public Mono> rejectCallWithResponseAsync( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.rejectCall(this.getEndpoint(), this.getApiVersion(), - rejectCallRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.rejectCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + rejectCallRequest, + accept, + context)); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rejectCallWithResponseAsync(RejectCallRequestInternal rejectCallRequest, - Context context) { + public Mono> rejectCallWithResponseAsync( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.rejectCall(this.getEndpoint(), this.getApiVersion(), rejectCallRequest, accept, - repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.rejectCall( + this.getEndpoint(), + this.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + rejectCallRequest, + accept, + context); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest) { - return rejectCallWithResponseAsync(rejectCallRequest).flatMap(ignored -> Mono.empty()); + public Mono rejectCallAsync( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap((Response res) -> Mono.empty()); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest, Context context) { - return rejectCallWithResponseAsync(rejectCallRequest, context).flatMap(ignored -> Mono.empty()); + public Mono rejectCallAsync( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap((Response res) -> Mono.empty()); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response rejectCallWithResponse(RejectCallRequestInternal rejectCallRequest, Context context) { - return rejectCallWithResponseAsync(rejectCallRequest, context).block(); + public void rejectCall( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + rejectCallAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** * Reject the call. - * + * * @param rejectCallRequest The reject call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rejectCall(RejectCallRequestInternal rejectCallRequest) { - rejectCallWithResponse(rejectCallRequest, Context.NONE); + public Response rejectCallWithResponse( + RejectCallRequestInternal rejectCallRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java index 69105e0ac49bc..83fd9474f1537 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java @@ -4,314 +4,227 @@ package com.azure.communication.callautomation.implementation; -import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.AzureKeyCredentialTrait; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.AzureKeyCredentialPolicy; +import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; -/** - * A builder for creating a new instance of the AzureCommunicationCallAutomationService type. - */ -@ServiceClientBuilder(serviceClients = { AzureCommunicationCallAutomationServiceImpl.class }) -public final class AzureCommunicationCallAutomationServiceImplBuilder - implements HttpTrait, - ConfigurationTrait, - AzureKeyCredentialTrait, - EndpointTrait { - @Generated +/** A builder for creating a new instance of the AzureCommunicationCallAutomationService type. */ +@ServiceClientBuilder(serviceClients = {AzureCommunicationCallAutomationServiceImpl.class}) +public final class AzureCommunicationCallAutomationServiceImplBuilder { private static final String SDK_NAME = "name"; - @Generated private static final String SDK_VERSION = "version"; - @Generated - private static final Map PROPERTIES = new HashMap<>(); + private final Map properties = new HashMap<>(); - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the AzureCommunicationCallAutomationServiceImplBuilder. - */ - @Generated + /** Create an instance of the AzureCommunicationCallAutomationServiceImplBuilder. */ public AzureCommunicationCallAutomationServiceImplBuilder() { this.pipelinePolicies = new ArrayList<>(); } /* - * The HTTP pipeline to send requests through. + * The endpoint of the Azure Communication resource. */ - @Generated - private HttpPipeline pipeline; + private String endpoint; /** - * {@inheritDoc}. + * Sets The endpoint of the Azure Communication resource. + * + * @param endpoint the endpoint value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * The HTTP client used to send the request. + * Api Version */ - @Generated - private HttpClient httpClient; + private String apiVersion; /** - * {@inheritDoc}. + * Sets Api Version. + * + * @param apiVersion the apiVersion value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; return this; } /* - * The logging configuration for HTTP requests and responses. + * The HTTP pipeline to send requests through */ - @Generated - private HttpLogOptions httpLogOptions; + private HttpPipeline pipeline; /** - * {@inheritDoc}. + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; + public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The client options such as application ID and custom headers to set on a request. + * The serializer to serialize an object into a string */ - @Generated - private ClientOptions clientOptions; + private SerializerAdapter serializerAdapter; /** - * {@inheritDoc}. + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; + public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; return this; } /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** - * {@inheritDoc}. + * The HTTP client used to send the request. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } + private HttpClient httpClient; /** - * {@inheritDoc}. + * Sets The HTTP client used to send the request. + * + * @param httpClient the httpClient value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); + public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The configuration store that is used during construction of the service client. + * The configuration store that is used during construction of the service + * client. */ - @Generated private Configuration configuration; /** - * {@inheritDoc}. + * Sets The configuration store that is used during construction of the service client. + * + * @param configuration the configuration value. + * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - @Override public AzureCommunicationCallAutomationServiceImplBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; } /* - * The AzureKeyCredential used for authentication. - */ - @Generated - private AzureKeyCredential azureKeyCredential; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder credential(AzureKeyCredential azureKeyCredential) { - this.azureKeyCredential = azureKeyCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Api Version + * The logging configuration for HTTP requests and responses. */ - @Generated - private String apiVersion; + private HttpLogOptions httpLogOptions; /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. + * Sets The logging configuration for HTTP requests and responses. + * + * @param httpLogOptions the httpLogOptions value. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; + public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; return this; } /* - * The serializer to serialize an object into a string + * The retry policy that will attempt to retry failed requests, if + * applicable. */ - @Generated - private SerializerAdapter serializerAdapter; + private RetryPolicy retryPolicy; /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; + public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; return this; } /* - * The retry policy that will attempt to retry failed requests, if applicable. + * The list of Http pipeline policies to add. */ - @Generated - private RetryPolicy retryPolicy; + private final List pipelinePolicies; /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. + * Adds a custom Http pipeline policy. + * + * @param customPolicy The custom Http pipeline policy to add. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - @Generated - public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; + public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); return this; } /** * Builds an instance of AzureCommunicationCallAutomationServiceImpl with the provided parameters. - * + * * @return an instance of AzureCommunicationCallAutomationServiceImpl. */ - @Generated public AzureCommunicationCallAutomationServiceImpl buildClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localApiVersion = (apiVersion != null) ? apiVersion : "2023-10-03-preview"; - SerializerAdapter localSerializerAdapter - = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); - AzureCommunicationCallAutomationServiceImpl client = new AzureCommunicationCallAutomationServiceImpl( - localPipeline, localSerializerAdapter, this.endpoint, localApiVersion); + if (apiVersion == null) { + this.apiVersion = "2023-10-03-preview"; + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + if (serializerAdapter == null) { + this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); + } + AzureCommunicationCallAutomationServiceImpl client = + new AzureCommunicationCallAutomationServiceImpl(pipeline, serializerAdapter, endpoint, apiVersion); return client; } - @Generated private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders() - .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); } - this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + policies.add( + new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration)); HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - if (azureKeyCredential != null) { - policies.add(new AzureKeyCredentialPolicy("Authorization", azureKeyCredential)); - } - this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + policies.addAll(this.pipelinePolicies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient).clientOptions(localClientOptions).build(); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .build(); return httpPipeline; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java index d80d13e3151ce..70653631ab7b2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java @@ -47,28 +47,22 @@ import java.util.UUID; import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in CallConnections. - */ +/** An instance of this class provides access to all the operations defined in CallConnections. */ public final class CallConnectionsImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final CallConnectionsService service; - /** - * The service client containing this operation class. - */ + /** The service client containing this operation class. */ private final AzureCommunicationCallAutomationServiceImpl client; /** * Initializes an instance of CallConnectionsImpl. - * + * * @param client the instance of the service client containing this operation class. */ CallConnectionsImpl(AzureCommunicationCallAutomationServiceImpl client) { - this.service - = RestProxy.create(CallConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = + RestProxy.create(CallConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -80,615 +74,857 @@ public final class CallConnectionsImpl { @ServiceInterface(name = "AzureCommunicationCa") public interface CallConnectionsService { @Get("/calling/callConnections/{callConnectionId}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> getCall(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getCall( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Delete("/calling/callConnections/{callConnectionId}") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> hangupCall(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> hangupCall( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:terminate") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> terminateCall(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> terminateCall( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:transferToParticipant") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> transferToParticipant(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TransferToParticipantRequestInternal transferToParticipantRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> transferToParticipant( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") TransferToParticipantRequestInternal transferToParticipantRequest, + @HeaderParam("Accept") String accept, + Context context); @Get("/calling/callConnections/{callConnectionId}/participants") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> getParticipants(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getParticipants( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}/participants:add") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> addParticipant(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AddParticipantRequestInternal addParticipantRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> addParticipant( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") AddParticipantRequestInternal addParticipantRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}/participants:remove") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> removeParticipant(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RemoveParticipantRequestInternal removeParticipantRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> removeParticipant( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") RemoveParticipantRequestInternal removeParticipantRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}/participants:mute") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> mute(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MuteParticipantsRequestInternal muteParticipantsRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> mute( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") MuteParticipantsRequestInternal muteParticipantsRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}/participants:unmute") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> unmute(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> unmute( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}/participants:cancelAddParticipant") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> cancelAddParticipant(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CancelAddParticipantRequest cancelAddParticipantRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> cancelAddParticipant( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") CancelAddParticipantRequest cancelAddParticipantRequest, + @HeaderParam("Accept") String accept, + Context context); @Get("/calling/callConnections/{callConnectionId}/participants/{participantRawId}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> getParticipant(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @PathParam("participantRawId") String participantRawId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getParticipant( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @PathParam("participantRawId") String participantRawId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Get("{nextLink}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> getParticipantsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call along with {@link Response} on successful completion of - * {@link Mono}. + * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getCallWithResponseAsync(String callConnectionId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCall(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.getCall( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + accept, + context)); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call along with {@link Response} on successful completion of - * {@link Mono}. + * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCallWithResponseAsync(String callConnectionId, - Context context) { + public Mono> getCallWithResponseAsync( + String callConnectionId, Context context) { final String accept = "application/json"; - return service.getCall(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, - context); + return service.getCall( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call on successful completion of {@link Mono}. + * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCallAsync(String callConnectionId) { - return getCallWithResponseAsync(callConnectionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getCallWithResponseAsync(callConnectionId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call on successful completion of {@link Mono}. + * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCallAsync(String callConnectionId, Context context) { - return getCallWithResponseAsync(callConnectionId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getCallWithResponseAsync(callConnectionId, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call along with {@link Response}. + * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCallWithResponse(String callConnectionId, Context context) { - return getCallWithResponseAsync(callConnectionId, context).block(); + public CallConnectionPropertiesInternal getCall(String callConnectionId) { + return getCallAsync(callConnectionId).block(); } /** * Get the detail properties of an ongoing call. - * + * * @param callConnectionId The call connection id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal getCall(String callConnectionId) { - return getCallWithResponse(callConnectionId, Context.NONE).getValue(); + public Response getCallWithResponse(String callConnectionId, Context context) { + return getCallWithResponseAsync(callConnectionId, context).block(); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> hangupCallWithResponseAsync(String callConnectionId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.hangupCall(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.hangupCall( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + accept, + context)); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> hangupCallWithResponseAsync(String callConnectionId, Context context) { final String accept = "application/json"; - return service.hangupCall(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, - context); + return service.hangupCall( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono hangupCallAsync(String callConnectionId) { - return hangupCallWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty()); + return hangupCallWithResponseAsync(callConnectionId).flatMap((Response res) -> Mono.empty()); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono hangupCallAsync(String callConnectionId, Context context) { - return hangupCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty()); + return hangupCallWithResponseAsync(callConnectionId, context).flatMap((Response res) -> Mono.empty()); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response hangupCallWithResponse(String callConnectionId, Context context) { - return hangupCallWithResponseAsync(callConnectionId, context).block(); + public void hangupCall(String callConnectionId) { + hangupCallAsync(callConnectionId).block(); } /** * Hang up call automation service from the call. This will make call automation service leave the call, but does * not terminate if there are more than 1 caller in the call. - * + * * @param callConnectionId The call connection id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void hangupCall(String callConnectionId) { - hangupCallWithResponse(callConnectionId, Context.NONE); + public Response hangupCallWithResponse(String callConnectionId, Context context) { + return hangupCallWithResponseAsync(callConnectionId, context).block(); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> terminateCallWithResponseAsync(String callConnectionId) { + public Mono> terminateCallWithResponseAsync( + String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.terminateCall(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.terminateCall( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + accept, + context)); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> terminateCallWithResponseAsync(String callConnectionId, Context context) { + public Mono> terminateCallWithResponseAsync( + String callConnectionId, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.terminateCall(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, - repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.terminateCall( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + accept, + context); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateCallAsync(String callConnectionId) { - return terminateCallWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty()); + public Mono terminateCallAsync( + String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { + return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap((Response res) -> Mono.empty()); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateCallAsync(String callConnectionId, Context context) { - return terminateCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty()); + public Mono terminateCallAsync( + String callConnectionId, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap((Response res) -> Mono.empty()); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response terminateCallWithResponse(String callConnectionId, Context context) { - return terminateCallWithResponseAsync(callConnectionId, context).block(); + public void terminateCall( + String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { + terminateCallAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** * Terminate a call using CallConnectionId. - * + * * @param callConnectionId The terminate call request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateCall(String callConnectionId) { - terminateCallWithResponse(callConnectionId, Context.NONE); + public Response terminateCallWithResponse( + String callConnectionId, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for transferring the call along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> transferToParticipantWithResponseAsync(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest) { + public Mono> transferToParticipantWithResponseAsync( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.transferToParticipant(this.client.getEndpoint(), - callConnectionId, this.client.getApiVersion(), transferToParticipantRequest, accept, repeatabilityRequestId, - repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.transferToParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + transferToParticipantRequest, + accept, + context)); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for transferring the call along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> transferToParticipantWithResponseAsync(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { + public Mono> transferToParticipantWithResponseAsync( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.transferToParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - transferToParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.transferToParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + transferToParticipantRequest, + accept, + context); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for transferring the call on successful completion of {@link Mono}. + * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono transferToParticipantAsync(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest) { - return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono transferToParticipantAsync( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return transferToParticipantWithResponseAsync( + callConnectionId, transferToParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for transferring the call on successful completion of {@link Mono}. + * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono transferToParticipantAsync(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { - return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono transferToParticipantAsync( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return transferToParticipantWithResponseAsync( + callConnectionId, + transferToParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for transferring the call along with {@link Response}. + * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response transferToParticipantWithResponse(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { - return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context).block(); + public TransferCallResponseInternal transferToParticipant( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return transferToParticipantAsync( + callConnectionId, transferToParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Transfer the call to a participant. - * + * * @param callConnectionId The call connection id. * @param transferToParticipantRequest The transfer to participant request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for transferring the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TransferCallResponseInternal transferToParticipant(String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest) { - return transferToParticipantWithResponse(callConnectionId, transferToParticipantRequest, Context.NONE) - .getValue(); + public Response transferToParticipantWithResponse( + String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return transferToParticipantWithResponseAsync( + callConnectionId, + transferToParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantsSinglePageAsync(String callConnectionId) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getParticipants(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getValue(), res.getValue().getNextLink(), null)); + return FluxUtil.withContext( + context -> + service.getParticipants( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + accept, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); } /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantsSinglePageAsync(String callConnectionId, - Context context) { + public Mono> getParticipantsSinglePageAsync( + String callConnectionId, Context context) { final String accept = "application/json"; - return service - .getParticipants(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getValue(), res.getValue().getNextLink(), null)); + return service.getParticipants( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); } /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call as paginated response with {@link PagedFlux}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux getParticipantsAsync(String callConnectionId) { - return new PagedFlux<>(() -> getParticipantsSinglePageAsync(callConnectionId), - nextLink -> getParticipantsNextSinglePageAsync(nextLink)); + return new PagedFlux<>( + () -> getParticipantsSinglePageAsync(callConnectionId), + nextLink -> getParticipantsNextSinglePageAsync(nextLink)); } /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call as paginated response with {@link PagedFlux}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux getParticipantsAsync(String callConnectionId, Context context) { - return new PagedFlux<>(() -> getParticipantsSinglePageAsync(callConnectionId, context), - nextLink -> getParticipantsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get participants from a call. Recording and transcription bots are omitted from this list. - * - * @param callConnectionId The call connection Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getParticipantsSinglePage(String callConnectionId) { - return getParticipantsSinglePageAsync(callConnectionId).block(); + return new PagedFlux<>( + () -> getParticipantsSinglePageAsync(callConnectionId, context), + nextLink -> getParticipantsNextSinglePageAsync(nextLink, context)); } /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * - * @param callConnectionId The call connection Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getParticipantsSinglePage(String callConnectionId, Context context) { - return getParticipantsSinglePageAsync(callConnectionId, context).block(); - } - - /** - * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call as paginated response with {@link PagedIterable}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getParticipants(String callConnectionId) { @@ -697,13 +933,13 @@ public PagedIterable getParticipants(String callConnect /** * Get participants from a call. Recording and transcription bots are omitted from this list. - * + * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call as paginated response with {@link PagedIterable}. + * @return participants from a call. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getParticipants(String callConnectionId, Context context) { @@ -712,740 +948,1289 @@ public PagedIterable getParticipants(String callConnect /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addParticipantWithResponseAsync(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest) { + public Mono> addParticipantWithResponseAsync( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); return FluxUtil.withContext( - context -> service.addParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - addParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + context -> + service.addParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + addParticipantRequest, + accept, + context)); } /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addParticipantWithResponseAsync(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, Context context) { + public Mono> addParticipantWithResponseAsync( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.addParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - addParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.addParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + addParticipantRequest, + accept, + context); } /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call on successful completion of {@link Mono}. + * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addParticipantAsync(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest) { - return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono addParticipantAsync( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return addParticipantWithResponseAsync( + callConnectionId, addParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call on successful completion of {@link Mono}. + * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addParticipantAsync(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, Context context) { - return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono addParticipantAsync( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return addParticipantWithResponseAsync( + callConnectionId, + addParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call along with {@link Response}. + * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response addParticipantWithResponse(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, Context context) { - return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context).block(); + public AddParticipantResponseInternal addParticipant( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return addParticipantAsync( + callConnectionId, addParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Add a participant to the call. - * + * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AddParticipantResponseInternal addParticipant(String callConnectionId, - AddParticipantRequestInternal addParticipantRequest) { - return addParticipantWithResponse(callConnectionId, addParticipantRequest, Context.NONE).getValue(); + public Response addParticipantWithResponse( + String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return addParticipantWithResponseAsync( + callConnectionId, + addParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeParticipantWithResponseAsync(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest) { + public Mono> removeParticipantWithResponseAsync( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.removeParticipant(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), removeParticipantRequest, accept, repeatabilityRequestId, - repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.removeParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + removeParticipantRequest, + accept, + context)); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeParticipantWithResponseAsync(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, Context context) { + public Mono> removeParticipantWithResponseAsync( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.removeParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - removeParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.removeParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + removeParticipantRequest, + accept, + context); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call on successful completion of {@link Mono}. + * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeParticipantAsync(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest) { - return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono removeParticipantAsync( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return removeParticipantWithResponseAsync( + callConnectionId, removeParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call on successful completion of {@link Mono}. + * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeParticipantAsync(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, Context context) { - return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono removeParticipantAsync( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return removeParticipantWithResponseAsync( + callConnectionId, + removeParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call along with {@link Response}. + * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeParticipantWithResponse(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, Context context) { - return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context).block(); + public RemoveParticipantResponseInternal removeParticipant( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return removeParticipantAsync( + callConnectionId, removeParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Remove a participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RemoveParticipantResponseInternal removeParticipant(String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest) { - return removeParticipantWithResponse(callConnectionId, removeParticipantRequest, Context.NONE).getValue(); + public Response removeParticipantWithResponse( + String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return removeParticipantWithResponseAsync( + callConnectionId, + removeParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> muteWithResponseAsync(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest) { + public Mono> muteWithResponseAsync( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); return FluxUtil.withContext( - context -> service.mute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - muteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + context -> + service.mute( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + muteParticipantsRequest, + accept, + context)); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> muteWithResponseAsync(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { + public Mono> muteWithResponseAsync( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.mute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - muteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.mute( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + muteParticipantsRequest, + accept, + context); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call on successful completion of {@link Mono}. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono muteAsync(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest) { - return muteWithResponseAsync(callConnectionId, muteParticipantsRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono muteAsync( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return muteWithResponseAsync( + callConnectionId, muteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call on successful completion of {@link Mono}. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono muteAsync(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { - return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono muteAsync( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return muteWithResponseAsync( + callConnectionId, + muteParticipantsRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call along with {@link Response}. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response muteWithResponse(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { - return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, context).block(); + public MuteParticipantsResultInternal mute( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return muteAsync(callConnectionId, muteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Mute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MuteParticipantsResultInternal mute(String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest) { - return muteWithResponse(callConnectionId, muteParticipantsRequest, Context.NONE).getValue(); + public Response muteWithResponse( + String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return muteWithResponseAsync( + callConnectionId, + muteParticipantsRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { + public Mono> unmuteWithResponseAsync( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); return FluxUtil.withContext( - context -> service.unmute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - unmuteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + context -> + service.unmute( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + unmuteParticipantsRequest, + accept, + context)); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { + public Mono> unmuteWithResponseAsync( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.unmute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - unmuteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.unmute( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + unmuteParticipantsRequest, + accept, + context); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call on successful completion of {@link Mono}. + * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteAsync(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { - return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono unmuteAsync( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return unmuteWithResponseAsync( + callConnectionId, unmuteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call on successful completion of {@link Mono}. + * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteAsync(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { - return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono unmuteAsync( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return unmuteWithResponseAsync( + callConnectionId, + unmuteParticipantsRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call along with {@link Response}. + * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response unmuteWithResponse(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { - return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest, context).block(); + public UnmuteParticipantsResponseInternal unmute( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return unmuteAsync(callConnectionId, unmuteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Unmute participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param unmuteParticipantsRequest The participants to be unmuted from the call. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for unmuting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UnmuteParticipantsResponseInternal unmute(String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { - return unmuteWithResponse(callConnectionId, unmuteParticipantsRequest, Context.NONE).getValue(); + public Response unmuteWithResponse( + String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return unmuteWithResponseAsync( + callConnectionId, + unmuteParticipantsRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request along with {@link Response} on successful completion - * of {@link Mono}. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAddParticipantWithResponseAsync(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest) { + public Mono> cancelAddParticipantWithResponseAsync( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil.withContext(context -> service.cancelAddParticipant(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), cancelAddParticipantRequest, accept, repeatabilityRequestId, - repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.cancelAddParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + cancelAddParticipantRequest, + accept, + context)); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request along with {@link Response} on successful completion - * of {@link Mono}. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAddParticipantWithResponseAsync(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { + public Mono> cancelAddParticipantWithResponseAsync( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.cancelAddParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - cancelAddParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.cancelAddParticipant( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + cancelAddParticipantRequest, + accept, + context); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request on successful completion of {@link Mono}. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAddParticipantAsync(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest) { - return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono cancelAddParticipantAsync( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return cancelAddParticipantWithResponseAsync( + callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request on successful completion of {@link Mono}. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAddParticipantAsync(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { - return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono cancelAddParticipantAsync( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return cancelAddParticipantWithResponseAsync( + callConnectionId, + cancelAddParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request along with {@link Response}. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAddParticipantWithResponse(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { - return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, context).block(); + public CancelAddParticipantResponse cancelAddParticipant( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return cancelAddParticipantAsync( + callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Cancel add participant operation. - * + * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CancelAddParticipantResponse cancelAddParticipant(String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest) { - return cancelAddParticipantWithResponse(callConnectionId, cancelAddParticipantRequest, Context.NONE).getValue(); + public Response cancelAddParticipantWithResponse( + String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return cancelAddParticipantWithResponseAsync( + callConnectionId, + cancelAddParticipantRequest, + repeatabilityRequestID, + repeatabilityFirstSent, + context) + .block(); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. + * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantWithResponseAsync(String callConnectionId, - String participantRawId) { + public Mono> getParticipantWithResponseAsync( + String callConnectionId, String participantRawId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getParticipant(this.client.getEndpoint(), callConnectionId, - participantRawId, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.getParticipant( + this.client.getEndpoint(), + callConnectionId, + participantRawId, + this.client.getApiVersion(), + accept, + context)); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. + * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantWithResponseAsync(String callConnectionId, - String participantRawId, Context context) { + public Mono> getParticipantWithResponseAsync( + String callConnectionId, String participantRawId, Context context) { final String accept = "application/json"; - return service.getParticipant(this.client.getEndpoint(), callConnectionId, participantRawId, - this.client.getApiVersion(), accept, context); + return service.getParticipant( + this.client.getEndpoint(), + callConnectionId, + participantRawId, + this.client.getApiVersion(), + accept, + context); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call on successful completion of {@link Mono}. + * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getParticipantAsync(String callConnectionId, String participantRawId) { return getParticipantWithResponseAsync(callConnectionId, participantRawId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call on successful completion of {@link Mono}. + * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getParticipantAsync(String callConnectionId, String participantRawId, - Context context) { + public Mono getParticipantAsync( + String callConnectionId, String participantRawId, Context context) { return getParticipantWithResponseAsync(callConnectionId, participantRawId, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call along with {@link Response}. + * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getParticipantWithResponse(String callConnectionId, - String participantRawId, Context context) { - return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).block(); + public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { + return getParticipantAsync(callConnectionId, participantRawId).block(); } /** * Get participant from a call. - * + * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { - return getParticipantWithResponse(callConnectionId, participantRawId, Context.NONE).getValue(); + public Response getParticipantWithResponse( + String callConnectionId, String participantRawId, Context context) { + return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response payload for getting participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantsNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getParticipantsNext(nextLink, this.client.getEndpoint(), accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getValue(), res.getValue().getNextLink(), null)); + return FluxUtil.withContext( + context -> service.getParticipantsNext(nextLink, this.client.getEndpoint(), accept, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response payload for getting participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantsNextSinglePageAsync(String nextLink, - Context context) { + public Mono> getParticipantsNextSinglePageAsync( + String nextLink, Context context) { final String accept = "application/json"; return service.getParticipantsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getValue(), res.getValue().getNextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getParticipantsNextSinglePage(String nextLink) { - return getParticipantsNextSinglePageAsync(nextLink).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getParticipantsNextSinglePage(String nextLink, Context context) { - return getParticipantsNextSinglePageAsync(nextLink, context).block(); + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java index d0d0bbf82187e..ac0ed614928ca 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java @@ -26,28 +26,22 @@ import com.azure.core.util.FluxUtil; import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in CallDialogs. - */ +/** An instance of this class provides access to all the operations defined in CallDialogs. */ public final class CallDialogsImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final CallDialogsService service; - /** - * The service client containing this operation class. - */ + /** The service client containing this operation class. */ private final AzureCommunicationCallAutomationServiceImpl client; /** * Initializes an instance of CallDialogsImpl. - * + * * @param client the instance of the service client containing this operation class. */ CallDialogsImpl(AzureCommunicationCallAutomationServiceImpl client) { - this.service - = RestProxy.create(CallDialogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = + RestProxy.create(CallDialogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,49 +53,60 @@ public final class CallDialogsImpl { @ServiceInterface(name = "AzureCommunicationCa") public interface CallDialogsService { @Put("/calling/callConnections/{callConnectionId}/dialogs/{dialogId}") - @ExpectedResponses({ 201 }) + @ExpectedResponses({201}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startDialog(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @PathParam("dialogId") String dialogId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartDialogRequestInternal startDialogRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> startDialog( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @PathParam("dialogId") String dialogId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartDialogRequestInternal startDialogRequest, + @HeaderParam("Accept") String accept, + Context context); @Delete("/calling/callConnections/{callConnectionId}/dialogs/{dialogId}") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopDialog(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @PathParam("dialogId") String dialogId, - @QueryParam("operationCallbackUri") String operationCallbackUri, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> stopDialog( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @PathParam("dialogId") String dialogId, + @QueryParam("operationCallbackUri") String operationCallbackUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startDialogWithResponseAsync(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest) { + public Mono> startDialogWithResponseAsync( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startDialog(this.client.getEndpoint(), callConnectionId, - dialogId, this.client.getApiVersion(), startDialogRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.startDialog( + this.client.getEndpoint(), + callConnectionId, + dialogId, + this.client.getApiVersion(), + startDialogRequest, + accept, + context)); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. @@ -109,41 +114,50 @@ public Mono> startDialogWithResponseAsync(String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startDialogWithResponseAsync(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest, Context context) { + public Mono> startDialogWithResponseAsync( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { final String accept = "application/json"; - return service.startDialog(this.client.getEndpoint(), callConnectionId, dialogId, this.client.getApiVersion(), - startDialogRequest, accept, context); + return service.startDialog( + this.client.getEndpoint(), + callConnectionId, + dialogId, + this.client.getApiVersion(), + startDialogRequest, + accept, + context); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startDialogAsync(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest) { + public Mono startDialogAsync( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. @@ -151,76 +165,87 @@ public Mono startDialogAsync(String callConnectionId, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startDialogAsync(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest, Context context) { + public Mono startDialogAsync( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startDialogWithResponse(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest, Context context) { - return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context).block(); + public DialogStateResponse startDialog( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { + return startDialogAsync(callConnectionId, dialogId, startDialogRequest).block(); } /** - * Start a dialog targeting a particular participant on the call. - * * Start a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param startDialogRequest The start dialog request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DialogStateResponse startDialog(String callConnectionId, String dialogId, - StartDialogRequestInternal startDialogRequest) { - return startDialogWithResponse(callConnectionId, dialogId, startDialogRequest, Context.NONE).getValue(); + public Response startDialogWithResponse( + String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { + return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context).block(); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync(String callConnectionId, String dialogId, - String operationCallbackUri) { + public Mono> stopDialogWithResponseAsync( + String callConnectionId, String dialogId, String operationCallbackUri) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopDialog(this.client.getEndpoint(), callConnectionId, dialogId, - operationCallbackUri, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.stopDialog( + this.client.getEndpoint(), + callConnectionId, + dialogId, + operationCallbackUri, + this.client.getApiVersion(), + accept, + context)); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. @@ -228,36 +253,42 @@ public Mono> stopDialogWithResponseAsync(String callConnectionId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync(String callConnectionId, String dialogId, - String operationCallbackUri, Context context) { + public Mono> stopDialogWithResponseAsync( + String callConnectionId, String dialogId, String operationCallbackUri, Context context) { final String accept = "application/json"; - return service.stopDialog(this.client.getEndpoint(), callConnectionId, dialogId, operationCallbackUri, - this.client.getApiVersion(), accept, context); + return service.stopDialog( + this.client.getEndpoint(), + callConnectionId, + dialogId, + operationCallbackUri, + this.client.getApiVersion(), + accept, + context); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopDialogAsync(String callConnectionId, String dialogId, String operationCallbackUri) { return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. @@ -265,45 +296,45 @@ public Mono stopDialogAsync(String callConnectionId, String dialogId, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopDialogAsync(String callConnectionId, String dialogId, String operationCallbackUri, - Context context) { + public Mono stopDialogAsync( + String callConnectionId, String dialogId, String operationCallbackUri, Context context) { return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDialogWithResponse(String callConnectionId, String dialogId, String operationCallbackUri, - Context context) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context).block(); + public void stopDialog(String callConnectionId, String dialogId, String operationCallbackUri) { + stopDialogAsync(callConnectionId, dialogId, operationCallbackUri).block(); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. * @param operationCallbackUri Opeation callback URI. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopDialog(String callConnectionId, String dialogId, String operationCallbackUri) { - stopDialogWithResponse(callConnectionId, dialogId, operationCallbackUri, Context.NONE); + public Response stopDialogWithResponse( + String callConnectionId, String dialogId, String operationCallbackUri, Context context) { + return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context).block(); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java index 5ac901e587240..a826d06ff9bed 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java @@ -11,10 +11,10 @@ import com.azure.communication.callautomation.implementation.models.SendDtmfTonesRequestInternal; import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; import com.azure.communication.callautomation.implementation.models.StartHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StartTranscriptionRequest; +import com.azure.communication.callautomation.implementation.models.StartTranscriptionRequestInternal; import com.azure.communication.callautomation.implementation.models.StopHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequest; -import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequest; +import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequestInternal; +import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequestInternal; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; @@ -36,28 +36,22 @@ import java.util.UUID; import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in CallMedias. - */ +/** An instance of this class provides access to all the operations defined in CallMedias. */ public final class CallMediasImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final CallMediasService service; - /** - * The service client containing this operation class. - */ + /** The service client containing this operation class. */ private final AzureCommunicationCallAutomationServiceImpl client; /** * Initializes an instance of CallMediasImpl. - * + * * @param client the instance of the service client containing this operation class. */ CallMediasImpl(AzureCommunicationCallAutomationServiceImpl client) { - this.service - = RestProxy.create(CallMediasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = + RestProxy.create(CallMediasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -69,1222 +63,1482 @@ public final class CallMediasImpl { @ServiceInterface(name = "AzureCommunicationCa") public interface CallMediasService { @Post("/calling/callConnections/{callConnectionId}:play") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> play(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PlayRequest playRequest, @HeaderParam("Accept") String accept, - Context context); + Mono> play( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PlayRequest playRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:startTranscription") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startTranscription(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartTranscriptionRequest startTranscriptionRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> startTranscription( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartTranscriptionRequestInternal startTranscriptionRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:stopTranscription") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopTranscription(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopTranscriptionRequest stopTranscriptionRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> stopTranscription( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopTranscriptionRequestInternal stopTranscriptionRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:cancelAllMediaOperations") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> cancelAllMediaOperations(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> cancelAllMediaOperations( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:recognize") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> recognize(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RecognizeRequest recognizeRequest, @HeaderParam("Accept") String accept, - Context context); + Mono> recognize( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RecognizeRequest recognizeRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:startContinuousDtmfRecognition") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startContinuousDtmfRecognition(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> startContinuousDtmfRecognition( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:stopContinuousDtmfRecognition") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopContinuousDtmfRecognition(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> stopContinuousDtmfRecognition( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:sendDtmfTones") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> sendDtmfTones(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SendDtmfTonesRequestInternal sendDtmfTonesRequest, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> sendDtmfTones( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") SendDtmfTonesRequestInternal sendDtmfTonesRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:updateTranscription") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> updateTranscription(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateTranscriptionRequest updateTranscriptionRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> updateTranscription( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateTranscriptionRequestInternal updateTranscriptionRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:startHoldMusic") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startHoldMusic(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartHoldMusicRequestInternal startHoldMusicRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> startHoldMusic( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartHoldMusicRequestInternal startHoldMusicRequest, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/callConnections/{callConnectionId}:stopHoldMusic") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopHoldMusic(@HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopHoldMusicRequestInternal stopHoldMusicRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> stopHoldMusic( + @HostParam("endpoint") String endpoint, + @PathParam("callConnectionId") String callConnectionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopHoldMusicRequestInternal stopHoldMusicRequest, + @HeaderParam("Accept") String accept, + Context context); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> playWithResponseAsync(String callConnectionId, PlayRequest playRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.play(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), playRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.play( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + playRequest, + accept, + context)); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> playWithResponseAsync(String callConnectionId, PlayRequest playRequest, - Context context) { + public Mono> playWithResponseAsync( + String callConnectionId, PlayRequest playRequest, Context context) { final String accept = "application/json"; - return service.play(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), playRequest, - accept, context); + return service.play( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), playRequest, accept, context); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest) { - return playWithResponseAsync(callConnectionId, playRequest).flatMap(ignored -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest).flatMap((Response res) -> Mono.empty()); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context).flatMap(ignored -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest, context) + .flatMap((Response res) -> Mono.empty()); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context).block(); + public void play(String callConnectionId, PlayRequest playRequest) { + playAsync(callConnectionId, playRequest).block(); } /** * Plays audio to participants in the call. - * + * * @param callConnectionId The call connection id. * @param playRequest play request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void play(String callConnectionId, PlayRequest playRequest) { - playWithResponse(callConnectionId, playRequest, Context.NONE); + public Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { + return playWithResponseAsync(callConnectionId, playRequest, context).block(); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync(String callConnectionId, - StartTranscriptionRequest startTranscriptionRequest) { + public Mono> startTranscriptionWithResponseAsync( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startTranscription(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), startTranscriptionRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.startTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + startTranscriptionRequest, + accept, + context)); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync(String callConnectionId, - StartTranscriptionRequest startTranscriptionRequest, Context context) { + public Mono> startTranscriptionWithResponseAsync( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { final String accept = "application/json"; - return service.startTranscription(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - startTranscriptionRequest, accept, context); + return service.startTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + startTranscriptionRequest, + accept, + context); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync(String callConnectionId, - StartTranscriptionRequest startTranscriptionRequest) { + public Mono startTranscriptionAsync( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync(String callConnectionId, - StartTranscriptionRequest startTranscriptionRequest, Context context) { + public Mono startTranscriptionAsync( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startTranscriptionWithResponse(String callConnectionId, - StartTranscriptionRequest startTranscriptionRequest, Context context) { - return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context).block(); + public void startTranscription( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { + startTranscriptionAsync(callConnectionId, startTranscriptionRequest).block(); } /** * Starts transcription in the call. - * + * * @param callConnectionId The call connection id. * @param startTranscriptionRequest The startTranscriptionRequest parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startTranscription(String callConnectionId, StartTranscriptionRequest startTranscriptionRequest) { - startTranscriptionWithResponse(callConnectionId, startTranscriptionRequest, Context.NONE); + public Response startTranscriptionWithResponse( + String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { + return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context).block(); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync(String callConnectionId, - StopTranscriptionRequest stopTranscriptionRequest) { + public Mono> stopTranscriptionWithResponseAsync( + String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopTranscription(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), stopTranscriptionRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.stopTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + stopTranscriptionRequest, + accept, + context)); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync(String callConnectionId, - StopTranscriptionRequest stopTranscriptionRequest, Context context) { + public Mono> stopTranscriptionWithResponseAsync( + String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { final String accept = "application/json"; - return service.stopTranscription(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - stopTranscriptionRequest, accept, context); + return service.stopTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + stopTranscriptionRequest, + accept, + context); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync(String callConnectionId, - StopTranscriptionRequest stopTranscriptionRequest) { + public Mono stopTranscriptionAsync( + String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync(String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, - Context context) { + public Mono stopTranscriptionAsync( + String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTranscriptionWithResponse(String callConnectionId, - StopTranscriptionRequest stopTranscriptionRequest, Context context) { - return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context).block(); + public void stopTranscription(String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { + stopTranscriptionAsync(callConnectionId, stopTranscriptionRequest).block(); } /** * Stops transcription in the call. - * + * * @param callConnectionId The call connection id. * @param stopTranscriptionRequest stop transcription request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopTranscription(String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) { - stopTranscriptionWithResponse(callConnectionId, stopTranscriptionRequest, Context.NONE); + public Response stopTranscriptionWithResponse( + String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { + return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context).block(); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.cancelAllMediaOperations(this.client.getEndpoint(), - callConnectionId, this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.cancelAllMediaOperations( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + accept, + context)); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId, Context context) { final String accept = "application/json"; - return service.cancelAllMediaOperations(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), accept, context); + return service.cancelAllMediaOperations( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAllMediaOperationsAsync(String callConnectionId) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty()); + return cancelAllMediaOperationsWithResponseAsync(callConnectionId) + .flatMap((Response res) -> Mono.empty()); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAllMediaOperationsAsync(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty()); + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context) + .flatMap((Response res) -> Mono.empty()); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).block(); + public void cancelAllMediaOperations(String callConnectionId) { + cancelAllMediaOperationsAsync(callConnectionId).block(); } /** * Cancel all media operations in a call. - * + * * @param callConnectionId The call connection id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAllMediaOperations(String callConnectionId) { - cancelAllMediaOperationsWithResponse(callConnectionId, Context.NONE); + public Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).block(); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> recognizeWithResponseAsync(String callConnectionId, RecognizeRequest recognizeRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.recognize(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), recognizeRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.recognize( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + recognizeRequest, + accept, + context)); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> recognizeWithResponseAsync(String callConnectionId, RecognizeRequest recognizeRequest, - Context context) { + public Mono> recognizeWithResponseAsync( + String callConnectionId, RecognizeRequest recognizeRequest, Context context) { final String accept = "application/json"; - return service.recognize(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - recognizeRequest, accept, context); + return service.recognize( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + recognizeRequest, + accept, + context); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest).flatMap(ignored -> Mono.empty()); + return recognizeWithResponseAsync(callConnectionId, recognizeRequest) + .flatMap((Response res) -> Mono.empty()); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest, Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).flatMap(ignored -> Mono.empty()); + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context) + .flatMap((Response res) -> Mono.empty()); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response recognizeWithResponse(String callConnectionId, RecognizeRequest recognizeRequest, - Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).block(); + public void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { + recognizeAsync(callConnectionId, recognizeRequest).block(); } /** * Recognize media from call. - * + * * @param callConnectionId The call connection id. * @param recognizeRequest The media recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { - recognizeWithResponse(callConnectionId, recognizeRequest, Context.NONE); + public Response recognizeWithResponse( + String callConnectionId, RecognizeRequest recognizeRequest, Context context) { + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).block(); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousDtmfRecognitionWithResponseAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono> startContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startContinuousDtmfRecognition(this.client.getEndpoint(), - callConnectionId, this.client.getApiVersion(), continuousDtmfRecognitionRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.startContinuousDtmfRecognition( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + continuousDtmfRecognitionRequest, + accept, + context)); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousDtmfRecognitionWithResponseAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + public Mono> startContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { final String accept = "application/json"; - return service.startContinuousDtmfRecognition(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), continuousDtmfRecognitionRequest, accept, context); + return service.startContinuousDtmfRecognition( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + continuousDtmfRecognitionRequest, + accept, + context); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono startContinuousDtmfRecognitionAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { - return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, - context).flatMap(ignored -> Mono.empty()); + public Mono startContinuousDtmfRecognitionAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return startContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .flatMap((Response res) -> Mono.empty()); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startContinuousDtmfRecognitionWithResponse(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { - return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, - context).block(); + public void startContinuousDtmfRecognition( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + startContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); } /** * Start continuous Dtmf recognition by subscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startContinuousDtmfRecognition(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - startContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); + public Response startContinuousDtmfRecognitionWithResponse( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return startContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .block(); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousDtmfRecognitionWithResponseAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono> stopContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopContinuousDtmfRecognition(this.client.getEndpoint(), - callConnectionId, this.client.getApiVersion(), continuousDtmfRecognitionRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.stopContinuousDtmfRecognition( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + continuousDtmfRecognitionRequest, + accept, + context)); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousDtmfRecognitionWithResponseAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + public Mono> stopContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { final String accept = "application/json"; - return service.stopContinuousDtmfRecognition(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), continuousDtmfRecognitionRequest, accept, context); + return service.stopContinuousDtmfRecognition( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + continuousDtmfRecognitionRequest, + accept, + context); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono stopContinuousDtmfRecognitionAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, - context).flatMap(ignored -> Mono.empty()); + public Mono stopContinuousDtmfRecognitionAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .flatMap((Response res) -> Mono.empty()); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopContinuousDtmfRecognitionWithResponse(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, - context).block(); + public void stopContinuousDtmfRecognition( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + stopContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); } /** * Stop continuous Dtmf recognition by unsubscribing to tones. - * + * * @param callConnectionId The call connection id. * @param continuousDtmfRecognitionRequest The continuous recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopContinuousDtmfRecognition(String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - stopContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); + public Response stopContinuousDtmfRecognitionWithResponse( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .block(); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendDtmfTonesWithResponseAsync(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest) { + public Mono> sendDtmfTonesWithResponseAsync( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); return FluxUtil.withContext( - context -> service.sendDtmfTones(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - sendDtmfTonesRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + context -> + service.sendDtmfTones( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + sendDtmfTonesRequest, + accept, + context)); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendDtmfTonesWithResponseAsync(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { + public Mono> sendDtmfTonesWithResponseAsync( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.sendDtmfTones(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - sendDtmfTonesRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.sendDtmfTones( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + sendDtmfTonesRequest, + accept, + context); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendDtmfTonesAsync(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest) { - return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono sendDtmfTonesAsync( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return sendDtmfTonesWithResponseAsync( + callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendDtmfTonesAsync(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { - return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono sendDtmfTonesAsync( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return sendDtmfTonesWithResponseAsync( + callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendDtmfTonesWithResponse(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { - return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context).block(); + public SendDtmfTonesResultInternal sendDtmfTones( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return sendDtmfTonesAsync( + callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent) + .block(); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SendDtmfTonesResultInternal sendDtmfTones(String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest) { - return sendDtmfTonesWithResponse(callConnectionId, sendDtmfTonesRequest, Context.NONE).getValue(); + public Response sendDtmfTonesWithResponse( + String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return sendDtmfTonesWithResponseAsync( + callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionWithResponseAsync(String callConnectionId, - UpdateTranscriptionRequest updateTranscriptionRequest) { + public Mono> updateTranscriptionWithResponseAsync( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateTranscription(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), updateTranscriptionRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.updateTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + updateTranscriptionRequest, + accept, + context)); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionWithResponseAsync(String callConnectionId, - UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { + public Mono> updateTranscriptionWithResponseAsync( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { final String accept = "application/json"; - return service.updateTranscription(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - updateTranscriptionRequest, accept, context); + return service.updateTranscription( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + updateTranscriptionRequest, + accept, + context); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionAsync(String callConnectionId, - UpdateTranscriptionRequest updateTranscriptionRequest) { + public Mono updateTranscriptionAsync( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionAsync(String callConnectionId, - UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { + public Mono updateTranscriptionAsync( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTranscriptionWithResponse(String callConnectionId, - UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { - return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context).block(); + public void updateTranscription( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { + updateTranscriptionAsync(callConnectionId, updateTranscriptionRequest).block(); } /** - * UpdateTranscription Api. - * * API to change transcription language. - * + * * @param callConnectionId The call connection id. * @param updateTranscriptionRequest The UpdateTranscription request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void updateTranscription(String callConnectionId, UpdateTranscriptionRequest updateTranscriptionRequest) { - updateTranscriptionWithResponse(callConnectionId, updateTranscriptionRequest, Context.NONE); + public Response updateTranscriptionWithResponse( + String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { + return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context).block(); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startHoldMusicWithResponseAsync(String callConnectionId, - StartHoldMusicRequestInternal startHoldMusicRequest) { + public Mono> startHoldMusicWithResponseAsync( + String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.startHoldMusic(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), startHoldMusicRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.startHoldMusic( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + startHoldMusicRequest, + accept, + context)); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startHoldMusicWithResponseAsync(String callConnectionId, - StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { + public Mono> startHoldMusicWithResponseAsync( + String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { final String accept = "application/json"; - return service.startHoldMusic(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - startHoldMusicRequest, accept, context); + return service.startHoldMusic( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + startHoldMusicRequest, + accept, + context); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusicAsync(String callConnectionId, - StartHoldMusicRequestInternal startHoldMusicRequest) { + public Mono startHoldMusicAsync( + String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusicAsync(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, - Context context) { + public Mono startHoldMusicAsync( + String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startHoldMusicWithResponse(String callConnectionId, - StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { - return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context).block(); + public void startHoldMusic(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { + startHoldMusicAsync(callConnectionId, startHoldMusicRequest).block(); } /** * Hold participant from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param startHoldMusicRequest The participants to be hold from the call. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startHoldMusic(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { - startHoldMusicWithResponse(callConnectionId, startHoldMusicRequest, Context.NONE); + public Response startHoldMusicWithResponse( + String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { + return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context).block(); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponseAsync(String callConnectionId, - StopHoldMusicRequestInternal stopHoldMusicRequest) { + public Mono> stopHoldMusicWithResponseAsync( + String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopHoldMusic(this.client.getEndpoint(), callConnectionId, - this.client.getApiVersion(), stopHoldMusicRequest, accept, context)); + return FluxUtil.withContext( + context -> + service.stopHoldMusic( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + stopHoldMusicRequest, + accept, + context)); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponseAsync(String callConnectionId, - StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { + public Mono> stopHoldMusicWithResponseAsync( + String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { final String accept = "application/json"; - return service.stopHoldMusic(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - stopHoldMusicRequest, accept, context); + return service.stopHoldMusic( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + stopHoldMusicRequest, + accept, + context); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopHoldMusicAsync(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest).flatMap(ignored -> Mono.empty()); + return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest) + .flatMap((Response res) -> Mono.empty()); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopHoldMusicAsync(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, - Context context) { + public Mono stopHoldMusicAsync( + String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context) - .flatMap(ignored -> Mono.empty()); + .flatMap((Response res) -> Mono.empty()); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopHoldMusicWithResponse(String callConnectionId, - StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context).block(); + public void stopHoldMusic(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { + stopHoldMusicAsync(callConnectionId, stopHoldMusicRequest).block(); } /** * Unhold participants from the call using identifier. - * + * * @param callConnectionId The call connection id. * @param stopHoldMusicRequest The participants to be hold from the call. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopHoldMusic(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - stopHoldMusicWithResponse(callConnectionId, stopHoldMusicRequest, Context.NONE); + public Response stopHoldMusicWithResponse( + String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { + return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context).block(); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java index 4e48ba94799d9..756dbdcb2f6b7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java @@ -30,28 +30,22 @@ import java.util.UUID; import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in CallRecordings. - */ +/** An instance of this class provides access to all the operations defined in CallRecordings. */ public final class CallRecordingsImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final CallRecordingsService service; - /** - * The service client containing this operation class. - */ + /** The service client containing this operation class. */ private final AzureCommunicationCallAutomationServiceImpl client; /** * Initializes an instance of CallRecordingsImpl. - * + * * @param client the instance of the service client containing this operation class. */ CallRecordingsImpl(AzureCommunicationCallAutomationServiceImpl client) { - this.service - = RestProxy.create(CallRecordingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = + RestProxy.create(CallRecordingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -63,507 +57,639 @@ public final class CallRecordingsImpl { @ServiceInterface(name = "AzureCommunicationCa") public interface CallRecordingsService { @Post("/calling/recordings") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startRecording(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartCallRecordingRequestInternal startCallRecording, - @HeaderParam("Accept") String accept, - @HeaderParam("repeatability-request-id") String repeatabilityRequestId, - @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + Mono> startRecording( + @HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, + @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, + @BodyParam("application/json") StartCallRecordingRequestInternal startCallRecording, + @HeaderParam("Accept") String accept, + Context context); @Get("/calling/recordings/{recordingId}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> getRecordingProperties(@HostParam("endpoint") String endpoint, - @PathParam("recordingId") String recordingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getRecordingProperties( + @HostParam("endpoint") String endpoint, + @PathParam("recordingId") String recordingId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Delete("/calling/recordings/{recordingId}") - @ExpectedResponses({ 204 }) + @ExpectedResponses({204}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopRecording(@HostParam("endpoint") String endpoint, - @PathParam("recordingId") String recordingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> stopRecording( + @HostParam("endpoint") String endpoint, + @PathParam("recordingId") String recordingId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/recordings/{recordingId}:pause") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> pauseRecording(@HostParam("endpoint") String endpoint, - @PathParam("recordingId") String recordingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> pauseRecording( + @HostParam("endpoint") String endpoint, + @PathParam("recordingId") String recordingId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); @Post("/calling/recordings/{recordingId}:resume") - @ExpectedResponses({ 202 }) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> resumeRecording(@HostParam("endpoint") String endpoint, - @PathParam("recordingId") String recordingId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> resumeRecording( + @HostParam("endpoint") String endpoint, + @PathParam("recordingId") String recordingId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - startRecordingWithResponseAsync(StartCallRecordingRequestInternal startCallRecording) { + public Mono> startRecordingWithResponseAsync( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return FluxUtil - .withContext(context -> service.startRecording(this.client.getEndpoint(), this.client.getApiVersion(), - startCallRecording, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return FluxUtil.withContext( + context -> + service.startRecording( + this.client.getEndpoint(), + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + startCallRecording, + accept, + context)); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - startRecordingWithResponseAsync(StartCallRecordingRequestInternal startCallRecording, Context context) { + public Mono> startRecordingWithResponseAsync( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { final String accept = "application/json"; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - return service.startRecording(this.client.getEndpoint(), this.client.getApiVersion(), startCallRecording, - accept, repeatabilityRequestId, repeatabilityFirstSent, context); + DateTimeRfc1123 repeatabilityFirstSentConverted = + repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + return service.startRecording( + this.client.getEndpoint(), + this.client.getApiVersion(), + repeatabilityRequestID, + repeatabilityFirstSentConverted, + startCallRecording, + accept, + context); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - startRecordingAsync(StartCallRecordingRequestInternal startCallRecording) { - return startRecordingWithResponseAsync(startCallRecording).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono startRecordingAsync( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return startRecordingWithResponseAsync(startCallRecording, repeatabilityRequestID, repeatabilityFirstSent) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - startRecordingAsync(StartCallRecordingRequestInternal startCallRecording, Context context) { - return startRecordingWithResponseAsync(startCallRecording, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono startRecordingAsync( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return startRecordingWithResponseAsync( + startCallRecording, repeatabilityRequestID, repeatabilityFirstSent, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. - * @param context The context to associate with this operation. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - startRecordingWithResponse(StartCallRecordingRequestInternal startCallRecording, Context context) { - return startRecordingWithResponseAsync(startCallRecording, context).block(); + public RecordingStateResponseInternal startRecording( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent) { + return startRecordingAsync(startCallRecording, repeatabilityRequestID, repeatabilityFirstSent).block(); } /** * Start recording the call. - * + * * @param startCallRecording The request body of start call recording request. + * @param repeatabilityRequestID 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. + * @param repeatabilityFirstSent 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal startRecording(StartCallRecordingRequestInternal startCallRecording) { - return startRecordingWithResponse(startCallRecording, Context.NONE).getValue(); + public Response startRecordingWithResponse( + StartCallRecordingRequestInternal startCallRecording, + UUID repeatabilityRequestID, + OffsetDateTime repeatabilityFirstSent, + Context context) { + return startRecordingWithResponseAsync( + startCallRecording, repeatabilityRequestID, repeatabilityFirstSent, context) + .block(); } /** * Get call recording properties. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. + * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecordingPropertiesWithResponseAsync(String recordingId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRecordingProperties(this.client.getEndpoint(), recordingId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.getRecordingProperties( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context)); } /** * Get call recording properties. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. + * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRecordingPropertiesWithResponseAsync(String recordingId, - Context context) { + public Mono> getRecordingPropertiesWithResponseAsync( + String recordingId, Context context) { final String accept = "application/json"; - return service.getRecordingProperties(this.client.getEndpoint(), recordingId, this.client.getApiVersion(), - accept, context); + return service.getRecordingProperties( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context); } /** * Get call recording properties. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties on successful completion of {@link Mono}. + * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId) { - return getRecordingPropertiesWithResponseAsync(recordingId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getRecordingPropertiesWithResponseAsync(recordingId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get call recording properties. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties on successful completion of {@link Mono}. + * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId, Context context) { return getRecordingPropertiesWithResponseAsync(recordingId, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Get call recording properties. - * + * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties along with {@link Response}. + * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRecordingPropertiesWithResponse(String recordingId, - Context context) { - return getRecordingPropertiesWithResponseAsync(recordingId, context).block(); + public RecordingStateResponseInternal getRecordingProperties(String recordingId) { + return getRecordingPropertiesAsync(recordingId).block(); } /** * Get call recording properties. - * + * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal getRecordingProperties(String recordingId) { - return getRecordingPropertiesWithResponse(recordingId, Context.NONE).getValue(); + public Response getRecordingPropertiesWithResponse( + String recordingId, Context context) { + return getRecordingPropertiesWithResponseAsync(recordingId, context).block(); } /** * Stop recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stopRecordingWithResponseAsync(String recordingId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopRecording(this.client.getEndpoint(), recordingId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.stopRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context)); } /** * Stop recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stopRecordingWithResponseAsync(String recordingId, Context context) { final String accept = "application/json"; - return service.stopRecording(this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, - context); + return service.stopRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context); } /** * Stop recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId) { - return stopRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); } /** * Stop recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); } /** * Stop recording the call. - * + * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopRecordingWithResponse(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).block(); + public void stopRecording(String recordingId) { + stopRecordingAsync(recordingId).block(); } /** * Stop recording the call. - * + * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopRecording(String recordingId) { - stopRecordingWithResponse(recordingId, Context.NONE); + public Response stopRecordingWithResponse(String recordingId, Context context) { + return stopRecordingWithResponseAsync(recordingId, context).block(); } /** * Pause recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pauseRecordingWithResponseAsync(String recordingId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.pauseRecording(this.client.getEndpoint(), recordingId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.pauseRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context)); } /** * Pause recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pauseRecordingWithResponseAsync(String recordingId, Context context) { final String accept = "application/json"; - return service.pauseRecording(this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, - context); + return service.pauseRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context); } /** * Pause recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId) { - return pauseRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); } /** * Pause recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); } /** * Pause recording the call. - * + * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response pauseRecordingWithResponse(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).block(); + public void pauseRecording(String recordingId) { + pauseRecordingAsync(recordingId).block(); } /** * Pause recording the call. - * + * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void pauseRecording(String recordingId) { - pauseRecordingWithResponse(recordingId, Context.NONE); + public Response pauseRecordingWithResponse(String recordingId, Context context) { + return pauseRecordingWithResponseAsync(recordingId, context).block(); } /** * Resume recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeRecordingWithResponseAsync(String recordingId) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.resumeRecording(this.client.getEndpoint(), recordingId, - this.client.getApiVersion(), accept, context)); + return FluxUtil.withContext( + context -> + service.resumeRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context)); } /** * Resume recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeRecordingWithResponseAsync(String recordingId, Context context) { final String accept = "application/json"; - return service.resumeRecording(this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, - context); + return service.resumeRecording( + this.client.getEndpoint(), recordingId, this.client.getApiVersion(), accept, context); } /** * Resume recording the call. - * + * * @param recordingId The recording id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId) { - return resumeRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); } /** * Resume recording the call. - * + * * @param recordingId The recording id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); } /** * Resume recording the call. - * + * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response resumeRecordingWithResponse(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).block(); + public void resumeRecording(String recordingId) { + resumeRecordingAsync(recordingId).block(); } /** * Resume recording the call. - * + * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void resumeRecording(String recordingId) { - resumeRecordingWithResponse(recordingId, Context.NONE); + public Response resumeRecordingWithResponse(String recordingId, Context context) { + return resumeRecordingWithResponseAsync(recordingId, context).block(); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java similarity index 93% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java index 486ca2d105d7e..3fa4e220b4197 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; -/** The MediaStreamingAudioInternal model. */ -public final class MediaStreamingAudioDataConverter { +/** The AudioDataInternal model. */ +public final class AudioDataConverter { /* * The audio data. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java similarity index 93% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java index 14d605a6e9f82..9fd8cf23cd36d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java @@ -5,8 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; -/** The MediaStreamingMetadataInternal model. */ -public final class MediaStreamingMetadataConverter { +/** The Audio + * MetadataInternal model. */ +public final class AudioMetadataConverter { /* * The mediaSubscriptionId. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java new file mode 100644 index 0000000000000..8dd1dcb653f03 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.implementation.converters; + +import com.azure.communication.callautomation.models.streaming.transcription.Word; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * The TranscriptionDataInternal model. + */ +public final class TranscriptionDataConverter { + + /* + * The display form of the recognized word + */ + @JsonProperty(value = "text") + private String text; + + /* + * The format of text + */ + @JsonProperty(value = "format") + private String format; + + /* + * Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) + */ + @JsonProperty(value = "confidence") + private double confidence; + + /* + * The position of this payload + */ + @JsonProperty(value = "offset") + private long offset; + + /* + * TThe result for each word of the phrase + */ + @JsonProperty(value = "words") + private List words; + + /* + * The participantId. + */ + @JsonProperty(value = "participantRawID") + private String participantRawID; + + /* + * Status of the result of transcription + */ + @JsonProperty(value = "resultStatus") + private String resultStatus; + + /** + * Get the text property. + * + * @return the text value. + */ + public String getText() { + return text; + } + + /** + * Get the format property. + * + * @return the format value. + */ + public String getFormat() { + return format; + } + + /** + * Get the confidence property. + * + * @return the confidence value. + */ + public double getConfidence() { + return confidence; + } + + /** + * Get the offset property. + * + * @return the offset value. + */ + public long getOffset() { + return offset; + } + + /** + * Get the words property. + * + * @return the words value. + */ + public List getWords() { + return words; + } + + /** + * Get the participantRawID property. + * + * @return the participantRawID value. + */ + public String getParticipantRawID() { + return participantRawID; + } + + + /** + * Get the resultStatus property. + * + * @return the resultStatus value. + */ + public String getResultStatus() { + return resultStatus; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java new file mode 100644 index 0000000000000..41ddb4b39425e --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.implementation.converters; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionMetadataInternal model. + */ +public final class TranscriptionMetadataConverter { + + /* + * Transcription Subscription Id. + */ + @JsonProperty(value = "subscriptionId") + private String transcriptionSubscriptionId; + + /* + * The target locale in which the translated text needs to be + */ + @JsonProperty(value = "locale") + private String locale; + + /* + * call connection Id. + */ + @JsonProperty(value = "callConnectionId") + private String callConnectionId; + + /* + * correlation Id + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * Get the transcriptionSubscriptionId property. + * + * @return the transcriptionSubscriptionId value. + */ + public String getTranscriptionSubscriptionId() { + return transcriptionSubscriptionId; + } + + /** + * Get the locale property. + * + * @return the locale value. + */ + public String getLocale() { + return locale; + } + + /** + * Get the callConnectionId property. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return callConnectionId; + } + + /** + * Get the correlationId property. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return correlationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java index f72809e5ff404..7cb288591f84e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java @@ -7,21 +7,22 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The request payload for adding participant to the call. - */ +/** The request payload for adding participant to the call. */ @Fluent public final class AddParticipantRequestInternal { /* - * The source caller Id, a phone number, that's shown to the PSTN participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN + * participant being invited. * Required only when inviting a PSTN participant. */ @JsonProperty(value = "sourceCallerIdNumber") private PhoneNumberIdentifierModel sourceCallerIdNumber; /* - * (Optional) The display name of the source that is associated with this invite operation when - * adding a PSTN participant or teams user. Note: Will not update the display name in the roster. + * (Optional) The display name of the source that is associated with this + * invite operation when + * adding a PSTN participant or teams user. Note: Will not update the + * display name in the roster. */ @JsonProperty(value = "sourceDisplayName") private String sourceDisplayName; @@ -40,7 +41,8 @@ public final class AddParticipantRequestInternal { private Integer invitationTimeoutInSeconds; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; @@ -52,24 +54,18 @@ public final class AddParticipantRequestInternal { private CustomCallingContext customCallingContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; /** - * Creates an instance of AddParticipantRequestInternal class. - */ - public AddParticipantRequestInternal() { - } - - /** - * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. - * Required only when inviting a PSTN participant. - * + * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant + * being invited. Required only when inviting a PSTN participant. + * * @return the sourceCallerIdNumber value. */ public PhoneNumberIdentifierModel getSourceCallerIdNumber() { @@ -77,10 +73,9 @@ public PhoneNumberIdentifierModel getSourceCallerIdNumber() { } /** - * Set the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. - * Required only when inviting a PSTN participant. - * + * Set the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant + * being invited. Required only when inviting a PSTN participant. + * * @param sourceCallerIdNumber the sourceCallerIdNumber value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -90,10 +85,9 @@ public AddParticipantRequestInternal setSourceCallerIdNumber(PhoneNumberIdentifi } /** - * Get the sourceDisplayName property: (Optional) The display name of the source that is associated with this - * invite operation when - * adding a PSTN participant or teams user. Note: Will not update the display name in the roster. - * + * Get the sourceDisplayName property: (Optional) The display name of the source that is associated with this invite + * operation when adding a PSTN participant or teams user. Note: Will not update the display name in the roster. + * * @return the sourceDisplayName value. */ public String getSourceDisplayName() { @@ -101,10 +95,9 @@ public String getSourceDisplayName() { } /** - * Set the sourceDisplayName property: (Optional) The display name of the source that is associated with this - * invite operation when - * adding a PSTN participant or teams user. Note: Will not update the display name in the roster. - * + * Set the sourceDisplayName property: (Optional) The display name of the source that is associated with this invite + * operation when adding a PSTN participant or teams user. Note: Will not update the display name in the roster. + * * @param sourceDisplayName the sourceDisplayName value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -115,7 +108,7 @@ public AddParticipantRequestInternal setSourceDisplayName(String sourceDisplayNa /** * Get the participantToAdd property: The participant to invite. - * + * * @return the participantToAdd value. */ public CommunicationIdentifierModel getParticipantToAdd() { @@ -124,7 +117,7 @@ public CommunicationIdentifierModel getParticipantToAdd() { /** * Set the participantToAdd property: The participant to invite. - * + * * @param participantToAdd the participantToAdd value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -135,9 +128,8 @@ public AddParticipantRequestInternal setParticipantToAdd(CommunicationIdentifier /** * Get the invitationTimeoutInSeconds property: Gets or sets the timeout to wait for the invited participant to - * pickup. - * The maximum value of this is 180 seconds. - * + * pickup. The maximum value of this is 180 seconds. + * * @return the invitationTimeoutInSeconds value. */ public Integer getInvitationTimeoutInSeconds() { @@ -146,9 +138,8 @@ public Integer getInvitationTimeoutInSeconds() { /** * Set the invitationTimeoutInSeconds property: Gets or sets the timeout to wait for the invited participant to - * pickup. - * The maximum value of this is 180 seconds. - * + * pickup. The maximum value of this is 180 seconds. + * * @param invitationTimeoutInSeconds the invitationTimeoutInSeconds value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -160,7 +151,7 @@ public AddParticipantRequestInternal setInvitationTimeoutInSeconds(Integer invit /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -170,7 +161,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -181,7 +172,7 @@ public AddParticipantRequestInternal setOperationContext(String operationContext /** * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @return the customCallingContext value. */ public CustomCallingContext getCustomCallingContext() { @@ -190,7 +181,7 @@ public CustomCallingContext getCustomCallingContext() { /** * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @param customCallingContext the customCallingContext value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -201,10 +192,9 @@ public AddParticipantRequestInternal setCustomCallingContext(CustomCallingContex /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -213,10 +203,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the AddParticipantRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java index 364ac42c7198b..8f07f98fa8cc3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The response payload for adding participants to the call. - */ +/** The response payload for adding participants to the call. */ @Fluent public final class AddParticipantResponseInternal { /* @@ -30,15 +28,9 @@ public final class AddParticipantResponseInternal { @JsonProperty(value = "invitationId") private String invitationId; - /** - * Creates an instance of AddParticipantResponseInternal class. - */ - public AddParticipantResponseInternal() { - } - /** * Get the participant property: List of current participants in the call. - * + * * @return the participant value. */ public CallParticipantInternal getParticipant() { @@ -47,7 +39,7 @@ public CallParticipantInternal getParticipant() { /** * Set the participant property: List of current participants in the call. - * + * * @param participant the participant value to set. * @return the AddParticipantResponseInternal object itself. */ @@ -58,7 +50,7 @@ public AddParticipantResponseInternal setParticipant(CallParticipantInternal par /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -67,7 +59,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the AddParticipantResponseInternal object itself. */ @@ -78,7 +70,7 @@ public AddParticipantResponseInternal setOperationContext(String operationContex /** * Get the invitationId property: Invitation ID used to add a participant. - * + * * @return the invitationId value. */ public String getInvitationId() { @@ -87,7 +79,7 @@ public String getInvitationId() { /** * Set the invitationId property: Invitation ID used to add a participant. - * + * * @param invitationId the invitationId value to set. * @return the AddParticipantResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java index 361d665d6b46b..21bba97a26c46 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The request payload for answering the call. - */ +/** The request payload for answering the call. */ @Fluent public final class AnswerCallRequestInternal { /* @@ -40,7 +38,7 @@ public final class AnswerCallRequestInternal { * Live Transcription Configuration. */ @JsonProperty(value = "transcriptionConfiguration") - private TranscriptionConfiguration transcriptionConfiguration; + private TranscriptionConfigurationInternal transcriptionConfiguration; /* * AI options for the call. @@ -54,15 +52,9 @@ public final class AnswerCallRequestInternal { @JsonProperty(value = "answeredBy") private CommunicationUserIdentifierModel answeredBy; - /** - * Creates an instance of AnswerCallRequestInternal class. - */ - public AnswerCallRequestInternal() { - } - /** * Get the incomingCallContext property: The context associated with the call. - * + * * @return the incomingCallContext value. */ public String getIncomingCallContext() { @@ -71,7 +63,7 @@ public String getIncomingCallContext() { /** * Set the incomingCallContext property: The context associated with the call. - * + * * @param incomingCallContext the incomingCallContext value to set. * @return the AnswerCallRequestInternal object itself. */ @@ -82,7 +74,7 @@ public AnswerCallRequestInternal setIncomingCallContext(String incomingCallConte /** * Get the callbackUri property: The callback uri. - * + * * @return the callbackUri value. */ public String getCallbackUri() { @@ -91,7 +83,7 @@ public String getCallbackUri() { /** * Set the callbackUri property: The callback uri. - * + * * @param callbackUri the callbackUri value to set. * @return the AnswerCallRequestInternal object itself. */ @@ -102,7 +94,7 @@ public AnswerCallRequestInternal setCallbackUri(String callbackUri) { /** * Get the operationContext property: A customer set value used to track the answering of a call. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -111,7 +103,7 @@ public String getOperationContext() { /** * Set the operationContext property: A customer set value used to track the answering of a call. - * + * * @param operationContext the operationContext value to set. * @return the AnswerCallRequestInternal object itself. */ @@ -122,7 +114,7 @@ public AnswerCallRequestInternal setOperationContext(String operationContext) { /** * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @return the mediaStreamingConfiguration value. */ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { @@ -131,40 +123,40 @@ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { /** * Set the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @param mediaStreamingConfiguration the mediaStreamingConfiguration value to set. * @return the AnswerCallRequestInternal object itself. */ - public AnswerCallRequestInternal - setMediaStreamingConfiguration(MediaStreamingConfigurationInternal mediaStreamingConfiguration) { + public AnswerCallRequestInternal setMediaStreamingConfiguration( + MediaStreamingConfigurationInternal mediaStreamingConfiguration) { this.mediaStreamingConfiguration = mediaStreamingConfiguration; return this; } /** * Get the transcriptionConfiguration property: Live Transcription Configuration. - * + * * @return the transcriptionConfiguration value. */ - public TranscriptionConfiguration getTranscriptionConfiguration() { + public TranscriptionConfigurationInternal getTranscriptionConfiguration() { return this.transcriptionConfiguration; } /** * Set the transcriptionConfiguration property: Live Transcription Configuration. - * + * * @param transcriptionConfiguration the transcriptionConfiguration value to set. * @return the AnswerCallRequestInternal object itself. */ - public AnswerCallRequestInternal - setTranscriptionConfiguration(TranscriptionConfiguration transcriptionConfiguration) { + public AnswerCallRequestInternal setTranscriptionConfiguration( + TranscriptionConfigurationInternal transcriptionConfiguration) { this.transcriptionConfiguration = transcriptionConfiguration; return this; } /** * Get the callIntelligenceOptions property: AI options for the call. - * + * * @return the callIntelligenceOptions value. */ public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { @@ -173,19 +165,19 @@ public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { /** * Set the callIntelligenceOptions property: AI options for the call. - * + * * @param callIntelligenceOptions the callIntelligenceOptions value to set. * @return the AnswerCallRequestInternal object itself. */ - public AnswerCallRequestInternal - setCallIntelligenceOptions(CallIntelligenceOptionsInternal callIntelligenceOptions) { + public AnswerCallRequestInternal setCallIntelligenceOptions( + CallIntelligenceOptionsInternal callIntelligenceOptions) { this.callIntelligenceOptions = callIntelligenceOptions; return this; } /** * Get the answeredBy property: The identifier of the call automation entity which answers the call. - * + * * @return the answeredBy value. */ public CommunicationUserIdentifierModel getAnsweredBy() { @@ -194,7 +186,7 @@ public CommunicationUserIdentifierModel getAnsweredBy() { /** * Set the answeredBy property: The identifier of the call automation entity which answers the call. - * + * * @param answeredBy the answeredBy value to set. * @return the AnswerCallRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java index da9e51f34aff8..585b697a00d22 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java @@ -4,30 +4,12 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; -/** - * Azure Open AI Dialog. - */ +/** Azure Open AI Dialog. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("AzureOpenAI") -@Fluent -public final class AzureOpenAIDialog extends BaseDialog { - /** - * Creates an instance of AzureOpenAIDialog class. - */ - public AzureOpenAIDialog() { - } - - /** - * {@inheritDoc} - */ - @Override - public AzureOpenAIDialog setContext(Map context) { - super.setContext(context); - return this; - } -} +@Immutable +public final class AzureOpenAIDialog extends BaseDialog {} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java index 4dc385cab8735..289dcaa83a41f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java @@ -11,17 +11,17 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** - * The BaseDialog model. - */ +/** The BaseDialog model. */ @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = BaseDialog.class) + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = BaseDialog.class) @JsonTypeName("BaseDialog") -@JsonSubTypes({ @JsonSubTypes.Type(name = "AzureOpenAI", value = AzureOpenAIDialog.class), - @JsonSubTypes.Type(name = "PowerVirtualAgents", value = PowerVirtualAgentsDialog.class) }) +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureOpenAI", value = AzureOpenAIDialog.class), + @JsonSubTypes.Type(name = "PowerVirtualAgents", value = PowerVirtualAgentsDialog.class) +}) @Fluent public class BaseDialog { /* @@ -30,15 +30,9 @@ public class BaseDialog { @JsonProperty(value = "context", required = true) private Map context; - /** - * Creates an instance of BaseDialog class. - */ - public BaseDialog() { - } - /** * Get the context property: Dialog context. - * + * * @return the context value. */ public Map getContext() { @@ -47,7 +41,7 @@ public Map getContext() { /** * Set the context property: Dialog context. - * + * * @param context the context value to set. * @return the BaseDialog object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java index 5a51ebbf65c3d..1fca59710f5b2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Used to specify Blob container url to recording storage. - */ +/** Used to specify Blob container url to recording storage. */ @Fluent public final class BlobStorageInternal { /* @@ -18,15 +16,9 @@ public final class BlobStorageInternal { @JsonProperty(value = "containerUri", required = true) private String containerUri; - /** - * Creates an instance of BlobStorageInternal class. - */ - public BlobStorageInternal() { - } - /** * Get the containerUri property: Url of a container or a location within a container. - * + * * @return the containerUri value. */ public String getContainerUri() { @@ -35,7 +27,7 @@ public String getContainerUri() { /** * Set the containerUri property: Url of a container or a location within a container. - * + * * @param containerUri the containerUri value to set. * @return the BlobStorageInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java index f29818170680e..b3274bf4e931e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * Properties of a call connection. - */ +/** Properties of a call connection. */ @Fluent public final class CallConnectionPropertiesInternal { /* @@ -56,7 +54,8 @@ public final class CallConnectionPropertiesInternal { private String dataSubscriptionId; /* - * The source caller Id, a phone number, that's shown to the PSTN participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN + * participant being invited. * Required only when calling a PSTN callee. */ @JsonProperty(value = "sourceCallerIdNumber") @@ -81,20 +80,15 @@ public final class CallConnectionPropertiesInternal { private String correlationId; /* - * Identity of the answering entity. Only populated when identity is provided in the request. + * Identity of the answering entity. Only populated when identity is + * provided in the request. */ @JsonProperty(value = "answeredBy") private CommunicationUserIdentifierModel answeredBy; - /** - * Creates an instance of CallConnectionPropertiesInternal class. - */ - public CallConnectionPropertiesInternal() { - } - /** * Get the callConnectionId property: The call connection id. - * + * * @return the callConnectionId value. */ public String getCallConnectionId() { @@ -103,7 +97,7 @@ public String getCallConnectionId() { /** * Set the callConnectionId property: The call connection id. - * + * * @param callConnectionId the callConnectionId value to set. * @return the CallConnectionPropertiesInternal object itself. */ @@ -114,7 +108,7 @@ public CallConnectionPropertiesInternal setCallConnectionId(String callConnectio /** * Get the serverCallId property: The server call id. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -123,7 +117,7 @@ public String getServerCallId() { /** * Set the serverCallId property: The server call id. - * + * * @param serverCallId the serverCallId value to set. * @return the CallConnectionPropertiesInternal object itself. */ @@ -134,7 +128,7 @@ public CallConnectionPropertiesInternal setServerCallId(String serverCallId) { /** * Get the targets property: The targets of the call. - * + * * @return the targets value. */ public List getTargets() { @@ -143,7 +137,7 @@ public List getTargets() { /** * Set the targets property: The targets of the call. - * + * * @param targets the targets value to set. * @return the CallConnectionPropertiesInternal object itself. */ @@ -154,7 +148,7 @@ public CallConnectionPropertiesInternal setTargets(List { - /** - * Static value unknown for CallConnectionStateModelInternal. - */ + /** Static value unknown for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal UNKNOWN = fromString("unknown"); - /** - * Static value connecting for CallConnectionStateModelInternal. - */ + /** Static value connecting for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal CONNECTING = fromString("connecting"); - /** - * Static value connected for CallConnectionStateModelInternal. - */ + /** Static value connected for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal CONNECTED = fromString("connected"); - /** - * Static value transferring for CallConnectionStateModelInternal. - */ + /** Static value transferring for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal TRANSFERRING = fromString("transferring"); - /** - * Static value transferAccepted for CallConnectionStateModelInternal. - */ + /** Static value transferAccepted for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal TRANSFER_ACCEPTED = fromString("transferAccepted"); - /** - * Static value disconnecting for CallConnectionStateModelInternal. - */ + /** Static value disconnecting for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal DISCONNECTING = fromString("disconnecting"); - /** - * Static value disconnected for CallConnectionStateModelInternal. - */ + /** Static value disconnected for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal DISCONNECTED = fromString("disconnected"); - /** - * Creates a new instance of CallConnectionStateModelInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CallConnectionStateModelInternal() { - } - /** * Creates or finds a CallConnectionStateModelInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding CallConnectionStateModelInternal. */ @@ -67,11 +42,7 @@ public static CallConnectionStateModelInternal fromString(String name) { return fromString(name, CallConnectionStateModelInternal.class); } - /** - * Gets known CallConnectionStateModelInternal values. - * - * @return known CallConnectionStateModelInternal values. - */ + /** @return known CallConnectionStateModelInternal values. */ public static Collection values() { return values(CallConnectionStateModelInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java index 11bef4b749158..5fecccb31a022 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * AI options for the call. - */ +/** AI options for the call. */ @Fluent public final class CallIntelligenceOptionsInternal { /* @@ -18,16 +16,10 @@ public final class CallIntelligenceOptionsInternal { @JsonProperty(value = "cognitiveServicesEndpoint") private String cognitiveServicesEndpoint; - /** - * Creates an instance of CallIntelligenceOptionsInternal class. - */ - public CallIntelligenceOptionsInternal() { - } - /** * Get the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this * call. - * + * * @return the cognitiveServicesEndpoint value. */ public String getCognitiveServicesEndpoint() { @@ -37,7 +29,7 @@ public String getCognitiveServicesEndpoint() { /** * Set the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this * call. - * + * * @param cognitiveServicesEndpoint the cognitiveServicesEndpoint value to set. * @return the CallIntelligenceOptionsInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java index acdf5f8c46eb4..847ccfe1bf766 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The locator used for joining or taking action on a call. - */ +/** The locator used for joining or taking action on a call. */ @Fluent public final class CallLocatorInternal { /* @@ -30,15 +28,9 @@ public final class CallLocatorInternal { @JsonProperty(value = "kind") private CallLocatorKindInternal kind; - /** - * Creates an instance of CallLocatorInternal class. - */ - public CallLocatorInternal() { - } - /** * Get the groupCallId property: The group call id. - * + * * @return the groupCallId value. */ public String getGroupCallId() { @@ -47,7 +39,7 @@ public String getGroupCallId() { /** * Set the groupCallId property: The group call id. - * + * * @param groupCallId the groupCallId value to set. * @return the CallLocatorInternal object itself. */ @@ -58,7 +50,7 @@ public CallLocatorInternal setGroupCallId(String groupCallId) { /** * Get the serverCallId property: The server call id. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -67,7 +59,7 @@ public String getServerCallId() { /** * Set the serverCallId property: The server call id. - * + * * @param serverCallId the serverCallId value to set. * @return the CallLocatorInternal object itself. */ @@ -78,7 +70,7 @@ public CallLocatorInternal setServerCallId(String serverCallId) { /** * Get the kind property: The call locator kind. - * + * * @return the kind value. */ public CallLocatorKindInternal getKind() { @@ -87,7 +79,7 @@ public CallLocatorKindInternal getKind() { /** * Set the kind property: The call locator kind. - * + * * @param kind the kind value to set. * @return the CallLocatorInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java index 1d89c642d2b45..5e413597d6186 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The call locator kind. - */ +/** Defines values for CallLocatorKindInternal. */ public final class CallLocatorKindInternal extends ExpandableStringEnum { - /** - * Static value groupCallLocator for CallLocatorKindInternal. - */ + /** Static value groupCallLocator for CallLocatorKindInternal. */ public static final CallLocatorKindInternal GROUP_CALL_LOCATOR = fromString("groupCallLocator"); - /** - * Static value serverCallLocator for CallLocatorKindInternal. - */ + /** Static value serverCallLocator for CallLocatorKindInternal. */ public static final CallLocatorKindInternal SERVER_CALL_LOCATOR = fromString("serverCallLocator"); - /** - * Creates a new instance of CallLocatorKindInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CallLocatorKindInternal() { - } - /** * Creates or finds a CallLocatorKindInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding CallLocatorKindInternal. */ @@ -42,11 +27,7 @@ public static CallLocatorKindInternal fromString(String name) { return fromString(name, CallLocatorKindInternal.class); } - /** - * Gets known CallLocatorKindInternal values. - * - * @return known CallLocatorKindInternal values. - */ + /** @return known CallLocatorKindInternal values. */ public static Collection values() { return values(CallLocatorKindInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java index f811a04484258..80baffee6fa6b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * A call participant. - */ +/** A call participant. */ @Fluent public final class CallParticipantInternal { /* @@ -24,15 +22,9 @@ public final class CallParticipantInternal { @JsonProperty(value = "isMuted") private Boolean isMuted; - /** - * Creates an instance of CallParticipantInternal class. - */ - public CallParticipantInternal() { - } - /** * Get the identifier property: Communication identifier of the participant. - * + * * @return the identifier value. */ public CommunicationIdentifierModel getIdentifier() { @@ -41,7 +33,7 @@ public CommunicationIdentifierModel getIdentifier() { /** * Set the identifier property: Communication identifier of the participant. - * + * * @param identifier the identifier value to set. * @return the CallParticipantInternal object itself. */ @@ -52,7 +44,7 @@ public CallParticipantInternal setIdentifier(CommunicationIdentifierModel identi /** * Get the isMuted property: Is participant muted. - * + * * @return the isMuted value. */ public Boolean isMuted() { @@ -61,7 +53,7 @@ public Boolean isMuted() { /** * Set the isMuted property: Is participant muted. - * + * * @param isMuted the isMuted value to set. * @return the CallParticipantInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java index fe73b087788c0..5cb7dc57aa9eb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java @@ -8,37 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The rejection reason. - */ +/** Defines values for CallRejectReasonInternal. */ public final class CallRejectReasonInternal extends ExpandableStringEnum { - /** - * Static value none for CallRejectReasonInternal. - */ + /** Static value none for CallRejectReasonInternal. */ public static final CallRejectReasonInternal NONE = fromString("none"); - /** - * Static value busy for CallRejectReasonInternal. - */ + /** Static value busy for CallRejectReasonInternal. */ public static final CallRejectReasonInternal BUSY = fromString("busy"); - /** - * Static value forbidden for CallRejectReasonInternal. - */ + /** Static value forbidden for CallRejectReasonInternal. */ public static final CallRejectReasonInternal FORBIDDEN = fromString("forbidden"); - /** - * Creates a new instance of CallRejectReasonInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CallRejectReasonInternal() { - } - /** * Creates or finds a CallRejectReasonInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding CallRejectReasonInternal. */ @@ -47,11 +30,7 @@ public static CallRejectReasonInternal fromString(String name) { return fromString(name, CallRejectReasonInternal.class); } - /** - * Gets known CallRejectReasonInternal values. - * - * @return known CallRejectReasonInternal values. - */ + /** @return known CallRejectReasonInternal values. */ public static Collection values() { return values(CallRejectReasonInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java index fecbd53b495fd..d5dc9122b965d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Request payload for cancelling add participant request. - */ +/** Request payload for cancelling add participant request. */ @Fluent public final class CancelAddParticipantRequest { /* @@ -19,28 +17,24 @@ public final class CancelAddParticipantRequest { private String invitationId; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of CancelAddParticipantRequest class. - */ - public CancelAddParticipantRequest() { - } - /** * Get the invitationId property: Invitation ID used to add a participant. - * + * * @return the invitationId value. */ public String getInvitationId() { @@ -49,7 +43,7 @@ public String getInvitationId() { /** * Set the invitationId property: Invitation ID used to add a participant. - * + * * @param invitationId the invitationId value to set. * @return the CancelAddParticipantRequest object itself. */ @@ -61,7 +55,7 @@ public CancelAddParticipantRequest setInvitationId(String invitationId) { /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -71,7 +65,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the CancelAddParticipantRequest object itself. */ @@ -82,10 +76,9 @@ public CancelAddParticipantRequest setOperationContext(String operationContext) /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -94,10 +87,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the CancelAddParticipantRequest object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java index 019dac89b0343..864ff38d0bd01 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Response payload for cancel add participant request. - */ +/** Response payload for cancel add participant request. */ @Fluent public final class CancelAddParticipantResponse { /* @@ -24,15 +22,9 @@ public final class CancelAddParticipantResponse { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of CancelAddParticipantResponse class. - */ - public CancelAddParticipantResponse() { - } - /** * Get the invitationId property: Invitation ID used to cancel the add participant action. - * + * * @return the invitationId value. */ public String getInvitationId() { @@ -41,7 +33,7 @@ public String getInvitationId() { /** * Set the invitationId property: Invitation ID used to cancel the add participant action. - * + * * @param invitationId the invitationId value to set. * @return the CancelAddParticipantResponse object itself. */ @@ -52,7 +44,7 @@ public CancelAddParticipantResponse setInvitationId(String invitationId) { /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -61,7 +53,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the CancelAddParticipantResponse object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java index ec3bf7e858909..b37390bef792a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java @@ -7,33 +7,27 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Channel affinity for a participant. - */ +/** Channel affinity for a participant. */ @Fluent public final class ChannelAffinityInternal { /* - * Channel number to which bitstream from a particular participant will be written. + * Channel number to which bitstream from a particular participant will be + * written. */ @JsonProperty(value = "channel") private Integer channel; /* - * The identifier for the participant whose bitstream will be written to the channel + * The identifier for the participant whose bitstream will be written to + * the channel * represented by the channel number. */ @JsonProperty(value = "participant", required = true) private CommunicationIdentifierModel participant; - /** - * Creates an instance of ChannelAffinityInternal class. - */ - public ChannelAffinityInternal() { - } - /** * Get the channel property: Channel number to which bitstream from a particular participant will be written. - * + * * @return the channel value. */ public Integer getChannel() { @@ -42,7 +36,7 @@ public Integer getChannel() { /** * Set the channel property: Channel number to which bitstream from a particular participant will be written. - * + * * @param channel the channel value to set. * @return the ChannelAffinityInternal object itself. */ @@ -54,7 +48,7 @@ public ChannelAffinityInternal setChannel(Integer channel) { /** * Get the participant property: The identifier for the participant whose bitstream will be written to the channel * represented by the channel number. - * + * * @return the participant value. */ public CommunicationIdentifierModel getParticipant() { @@ -64,7 +58,7 @@ public CommunicationIdentifierModel getParticipant() { /** * Set the participant property: The identifier for the participant whose bitstream will be written to the channel * represented by the channel number. - * + * * @param participant the participant value to set. * @return the ChannelAffinityInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java index 0d3ba4bbdaf80..f5a782746b19c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The ChoiceResultInternal model. - */ +/** The ChoiceResultInternal model. */ @Fluent public final class ChoiceResultInternal { /* @@ -20,21 +18,15 @@ public final class ChoiceResultInternal { /* * Phrases are set to the value if choice is selected via phrase detection. - * If Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set - * to null + * If Dtmf input is recognized, then Label will be the identifier for the + * choice detected and phrases will be set to null */ @JsonProperty(value = "recognizedPhrase") private String recognizedPhrase; - /** - * Creates an instance of ChoiceResultInternal class. - */ - public ChoiceResultInternal() { - } - /** * Get the label property: Label is the primary identifier for the choice detected. - * + * * @return the label value. */ public String getLabel() { @@ -43,7 +35,7 @@ public String getLabel() { /** * Set the label property: Label is the primary identifier for the choice detected. - * + * * @param label the label value to set. * @return the ChoiceResultInternal object itself. */ @@ -53,10 +45,10 @@ public ChoiceResultInternal setLabel(String label) { } /** - * Get the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. - * If Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set - * to null. - * + * Get the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. If + * Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to + * null. + * * @return the recognizedPhrase value. */ public String getRecognizedPhrase() { @@ -64,10 +56,10 @@ public String getRecognizedPhrase() { } /** - * Set the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. - * If Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set - * to null. - * + * Set the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. If + * Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to + * null. + * * @param recognizedPhrase the recognizedPhrase value to set. * @return the ChoiceResultInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java index 59f4b817ad57f..a6a19aa3dd559 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The CollectTonesResultInternal model. - */ +/** The CollectTonesResultInternal model. */ @Immutable public final class CollectTonesResultInternal { /* @@ -19,15 +17,9 @@ public final class CollectTonesResultInternal { @JsonProperty(value = "tones", access = JsonProperty.Access.WRITE_ONLY) private List tones; - /** - * Creates an instance of CollectTonesResultInternal class. - */ - public CollectTonesResultInternal() { - } - /** * Get the tones property: The tones property. - * + * * @return the tones value. */ public List getTones() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java index 1939287a2d712..07a1b2042c1cb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java @@ -8,37 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The cloud that the identifier belongs to. - */ +/** Defines values for CommunicationCloudEnvironmentModel. */ public final class CommunicationCloudEnvironmentModel extends ExpandableStringEnum { - /** - * Static value public for CommunicationCloudEnvironmentModel. - */ + /** Static value public for CommunicationCloudEnvironmentModel. */ public static final CommunicationCloudEnvironmentModel PUBLIC = fromString("public"); - /** - * Static value dod for CommunicationCloudEnvironmentModel. - */ + /** Static value dod for CommunicationCloudEnvironmentModel. */ public static final CommunicationCloudEnvironmentModel DOD = fromString("dod"); - /** - * Static value gcch for CommunicationCloudEnvironmentModel. - */ + /** Static value gcch for CommunicationCloudEnvironmentModel. */ public static final CommunicationCloudEnvironmentModel GCCH = fromString("gcch"); - /** - * Creates a new instance of CommunicationCloudEnvironmentModel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CommunicationCloudEnvironmentModel() { - } - /** * Creates or finds a CommunicationCloudEnvironmentModel from its string representation. - * + * * @param name a name to look for. * @return the corresponding CommunicationCloudEnvironmentModel. */ @@ -47,11 +30,7 @@ public static CommunicationCloudEnvironmentModel fromString(String name) { return fromString(name, CommunicationCloudEnvironmentModel.class); } - /** - * Gets known CommunicationCloudEnvironmentModel values. - * - * @return known CommunicationCloudEnvironmentModel values. - */ + /** @return known CommunicationCloudEnvironmentModel values. */ public static Collection values() { return values(CommunicationCloudEnvironmentModel.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java index ab89c63ae509a..ee390d3e598f8 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The Communication Services error. - */ +/** The Communication Services error. */ @Fluent public final class CommunicationError { /* @@ -43,15 +41,9 @@ public final class CommunicationError { @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) private CommunicationError innerError; - /** - * Creates an instance of CommunicationError class. - */ - public CommunicationError() { - } - /** * Get the code property: The error code. - * + * * @return the code value. */ public String getCode() { @@ -60,7 +52,7 @@ public String getCode() { /** * Set the code property: The error code. - * + * * @param code the code value to set. * @return the CommunicationError object itself. */ @@ -71,7 +63,7 @@ public CommunicationError setCode(String code) { /** * Get the message property: The error message. - * + * * @return the message value. */ public String getMessage() { @@ -80,7 +72,7 @@ public String getMessage() { /** * Set the message property: The error message. - * + * * @param message the message value to set. * @return the CommunicationError object itself. */ @@ -91,7 +83,7 @@ public CommunicationError setMessage(String message) { /** * Get the target property: The error target. - * + * * @return the target value. */ public String getTarget() { @@ -100,7 +92,7 @@ public String getTarget() { /** * Get the details property: Further details about specific errors that led to this error. - * + * * @return the details value. */ public List getDetails() { @@ -109,7 +101,7 @@ public List getDetails() { /** * Get the innerError property: The inner error if any. - * + * * @return the innerError value. */ public CommunicationError getInnerError() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java index 3a604646923e9..4403b761aa544 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The Communication Services error. - */ +/** The Communication Services error. */ @Fluent public final class CommunicationErrorResponse { /* @@ -18,15 +16,9 @@ public final class CommunicationErrorResponse { @JsonProperty(value = "error", required = true) private CommunicationError error; - /** - * Creates an instance of CommunicationErrorResponse class. - */ - public CommunicationErrorResponse() { - } - /** * Get the error property: The Communication Services error. - * + * * @return the error value. */ public CommunicationError getError() { @@ -35,7 +27,7 @@ public CommunicationError getError() { /** * Set the error property: The Communication Services error. - * + * * @param error the error value to set. * @return the CommunicationErrorResponse object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java index 919c88bc5e90d..d591a9a16cff8 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java @@ -7,13 +7,11 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpResponse; -/** - * Exception thrown for an invalid response with CommunicationErrorResponse information. - */ +/** Exception thrown for an invalid response with CommunicationErrorResponse information. */ public final class CommunicationErrorResponseException extends HttpResponseException { /** * Initializes a new instance of the CommunicationErrorResponseException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. */ @@ -23,19 +21,16 @@ public CommunicationErrorResponseException(String message, HttpResponse response /** * Initializes a new instance of the CommunicationErrorResponseException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. * @param value the deserialized response value. */ - public CommunicationErrorResponseException(String message, HttpResponse response, - CommunicationErrorResponse value) { + public CommunicationErrorResponseException( + String message, HttpResponse response, CommunicationErrorResponse value) { super(message, response, value); } - /** - * {@inheritDoc} - */ @Override public CommunicationErrorResponse getValue() { return (CommunicationErrorResponse) super.getValue(); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java index 0ba691ca947b6..4892a9df8e90a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java @@ -44,15 +44,9 @@ public final class CommunicationIdentifierModel { @JsonProperty(value = "microsoftTeamsUser") private MicrosoftTeamsUserIdentifierModel microsoftTeamsUser; - /** - * Creates an instance of CommunicationIdentifierModel class. - */ - public CommunicationIdentifierModel() { - } - /** * Get the kind property: The identifier kind. Only required in responses. - * + * * @return the kind value. */ public CommunicationIdentifierModelKind getKind() { @@ -61,7 +55,7 @@ public CommunicationIdentifierModelKind getKind() { /** * Set the kind property: The identifier kind. Only required in responses. - * + * * @param kind the kind value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -72,7 +66,7 @@ public CommunicationIdentifierModel setKind(CommunicationIdentifierModelKind kin /** * Get the rawId property: Raw Id of the identifier. Optional in requests, required in responses. - * + * * @return the rawId value. */ public String getRawId() { @@ -81,7 +75,7 @@ public String getRawId() { /** * Set the rawId property: Raw Id of the identifier. Optional in requests, required in responses. - * + * * @param rawId the rawId value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -92,7 +86,7 @@ public CommunicationIdentifierModel setRawId(String rawId) { /** * Get the communicationUser property: The communication user. - * + * * @return the communicationUser value. */ public CommunicationUserIdentifierModel getCommunicationUser() { @@ -101,7 +95,7 @@ public CommunicationUserIdentifierModel getCommunicationUser() { /** * Set the communicationUser property: The communication user. - * + * * @param communicationUser the communicationUser value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -112,7 +106,7 @@ public CommunicationIdentifierModel setCommunicationUser(CommunicationUserIdenti /** * Get the phoneNumber property: The phone number. - * + * * @return the phoneNumber value. */ public PhoneNumberIdentifierModel getPhoneNumber() { @@ -121,7 +115,7 @@ public PhoneNumberIdentifierModel getPhoneNumber() { /** * Set the phoneNumber property: The phone number. - * + * * @param phoneNumber the phoneNumber value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -132,7 +126,7 @@ public CommunicationIdentifierModel setPhoneNumber(PhoneNumberIdentifierModel ph /** * Get the microsoftTeamsUser property: The Microsoft Teams user. - * + * * @return the microsoftTeamsUser value. */ public MicrosoftTeamsUserIdentifierModel getMicrosoftTeamsUser() { @@ -141,7 +135,7 @@ public MicrosoftTeamsUserIdentifierModel getMicrosoftTeamsUser() { /** * Set the microsoftTeamsUser property: The Microsoft Teams user. - * + * * @param microsoftTeamsUser the microsoftTeamsUser value to set. * @return the CommunicationIdentifierModel object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java index 5f99503d41f1d..dd31e3047e264 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java @@ -8,42 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The identifier kind, for example 'communicationUser' or 'phoneNumber'. - */ +/** Defines values for CommunicationIdentifierModelKind. */ public final class CommunicationIdentifierModelKind extends ExpandableStringEnum { - /** - * Static value unknown for CommunicationIdentifierModelKind. - */ + /** Static value unknown for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind UNKNOWN = fromString("unknown"); - /** - * Static value communicationUser for CommunicationIdentifierModelKind. - */ + /** Static value communicationUser for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind COMMUNICATION_USER = fromString("communicationUser"); - /** - * Static value phoneNumber for CommunicationIdentifierModelKind. - */ + /** Static value phoneNumber for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind PHONE_NUMBER = fromString("phoneNumber"); - /** - * Static value microsoftTeamsUser for CommunicationIdentifierModelKind. - */ + /** Static value microsoftTeamsUser for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind MICROSOFT_TEAMS_USER = fromString("microsoftTeamsUser"); - /** - * Creates a new instance of CommunicationIdentifierModelKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CommunicationIdentifierModelKind() { - } - /** * Creates or finds a CommunicationIdentifierModelKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding CommunicationIdentifierModelKind. */ @@ -52,11 +33,7 @@ public static CommunicationIdentifierModelKind fromString(String name) { return fromString(name, CommunicationIdentifierModelKind.class); } - /** - * Gets known CommunicationIdentifierModelKind values. - * - * @return known CommunicationIdentifierModelKind values. - */ + /** @return known CommunicationIdentifierModelKind values. */ public static Collection values() { return values(CommunicationIdentifierModelKind.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java index dbc8b5fcf3dc5..181bfb121ae41 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * A user that got created with an Azure Communication Services resource. - */ +/** A user that got created with an Azure Communication Services resource. */ @Fluent public final class CommunicationUserIdentifierModel { /* @@ -18,15 +16,9 @@ public final class CommunicationUserIdentifierModel { @JsonProperty(value = "id", required = true) private String id; - /** - * Creates an instance of CommunicationUserIdentifierModel class. - */ - public CommunicationUserIdentifierModel() { - } - /** * Get the id property: The Id of the communication user. - * + * * @return the id value. */ public String getId() { @@ -35,7 +27,7 @@ public String getId() { /** * Set the id property: The Id of the communication user. - * + * * @param id the id value to set. * @return the CommunicationUserIdentifierModel object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java index fcf3a6874f38a..f822115fb8fae 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The ContinuousDtmfRecognitionRequestInternal model. - */ +/** The ContinuousDtmfRecognitionRequestInternal model. */ @Fluent public final class ContinuousDtmfRecognitionRequestInternal { /* @@ -25,22 +23,17 @@ public final class ContinuousDtmfRecognitionRequestInternal { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of ContinuousDtmfRecognitionRequestInternal class. - */ - public ContinuousDtmfRecognitionRequestInternal() { - } - /** * Get the targetParticipant property: Defines options for recognition. - * + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -49,19 +42,19 @@ public CommunicationIdentifierModel getTargetParticipant() { /** * Set the targetParticipant property: Defines options for recognition. - * + * * @param targetParticipant the targetParticipant value to set. * @return the ContinuousDtmfRecognitionRequestInternal object itself. */ - public ContinuousDtmfRecognitionRequestInternal - setTargetParticipant(CommunicationIdentifierModel targetParticipant) { + public ContinuousDtmfRecognitionRequestInternal setTargetParticipant( + CommunicationIdentifierModel targetParticipant) { this.targetParticipant = targetParticipant; return this; } /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -70,7 +63,7 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. * @return the ContinuousDtmfRecognitionRequestInternal object itself. */ @@ -81,10 +74,9 @@ public ContinuousDtmfRecognitionRequestInternal setOperationContext(String opera /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -93,10 +85,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the ContinuousDtmfRecognitionRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java index ec4d10c624542..e7779e2d62dc4 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The request payload for creating the call. - */ +/** The request payload for creating the call. */ @Fluent public final class CreateCallRequestInternal { /* @@ -20,7 +18,8 @@ public final class CreateCallRequestInternal { private List targets; /* - * The source caller Id, a phone number, that's shown to the PSTN participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN + * participant being invited. * Required only when calling a PSTN callee. */ @JsonProperty(value = "sourceCallerIdNumber") @@ -60,7 +59,7 @@ public final class CreateCallRequestInternal { * Live Transcription Configuration. */ @JsonProperty(value = "transcriptionConfiguration") - private TranscriptionConfiguration transcriptionConfiguration; + private TranscriptionConfigurationInternal transcriptionConfiguration; /* * AI options for the call. @@ -74,15 +73,9 @@ public final class CreateCallRequestInternal { @JsonProperty(value = "customCallingContext") private CustomCallingContext customCallingContext; - /** - * Creates an instance of CreateCallRequestInternal class. - */ - public CreateCallRequestInternal() { - } - /** * Get the targets property: The targets of the call. - * + * * @return the targets value. */ public List getTargets() { @@ -91,7 +84,7 @@ public List getTargets() { /** * Set the targets property: The targets of the call. - * + * * @param targets the targets value to set. * @return the CreateCallRequestInternal object itself. */ @@ -101,10 +94,9 @@ public CreateCallRequestInternal setTargets(List t } /** - * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. - * Required only when calling a PSTN callee. - * + * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant + * being invited. Required only when calling a PSTN callee. + * * @return the sourceCallerIdNumber value. */ public PhoneNumberIdentifierModel getSourceCallerIdNumber() { @@ -112,10 +104,9 @@ public PhoneNumberIdentifierModel getSourceCallerIdNumber() { } /** - * Set the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. - * Required only when calling a PSTN callee. - * + * Set the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant + * being invited. Required only when calling a PSTN callee. + * * @param sourceCallerIdNumber the sourceCallerIdNumber value to set. * @return the CreateCallRequestInternal object itself. */ @@ -126,7 +117,7 @@ public CreateCallRequestInternal setSourceCallerIdNumber(PhoneNumberIdentifierMo /** * Get the sourceDisplayName property: Display name of the call if dialing out to a pstn number. - * + * * @return the sourceDisplayName value. */ public String getSourceDisplayName() { @@ -135,7 +126,7 @@ public String getSourceDisplayName() { /** * Set the sourceDisplayName property: Display name of the call if dialing out to a pstn number. - * + * * @param sourceDisplayName the sourceDisplayName value to set. * @return the CreateCallRequestInternal object itself. */ @@ -146,7 +137,7 @@ public CreateCallRequestInternal setSourceDisplayName(String sourceDisplayName) /** * Get the source property: The identifier of the source of the call. - * + * * @return the source value. */ public CommunicationUserIdentifierModel getSource() { @@ -155,7 +146,7 @@ public CommunicationUserIdentifierModel getSource() { /** * Set the source property: The identifier of the source of the call. - * + * * @param source the source value to set. * @return the CreateCallRequestInternal object itself. */ @@ -166,7 +157,7 @@ public CreateCallRequestInternal setSource(CommunicationUserIdentifierModel sour /** * Get the operationContext property: A customer set value used to track the answering of a call. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -175,7 +166,7 @@ public String getOperationContext() { /** * Set the operationContext property: A customer set value used to track the answering of a call. - * + * * @param operationContext the operationContext value to set. * @return the CreateCallRequestInternal object itself. */ @@ -186,7 +177,7 @@ public CreateCallRequestInternal setOperationContext(String operationContext) { /** * Get the callbackUri property: The callback URI. - * + * * @return the callbackUri value. */ public String getCallbackUri() { @@ -195,7 +186,7 @@ public String getCallbackUri() { /** * Set the callbackUri property: The callback URI. - * + * * @param callbackUri the callbackUri value to set. * @return the CreateCallRequestInternal object itself. */ @@ -206,7 +197,7 @@ public CreateCallRequestInternal setCallbackUri(String callbackUri) { /** * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @return the mediaStreamingConfiguration value. */ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { @@ -215,40 +206,40 @@ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { /** * Set the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @param mediaStreamingConfiguration the mediaStreamingConfiguration value to set. * @return the CreateCallRequestInternal object itself. */ - public CreateCallRequestInternal - setMediaStreamingConfiguration(MediaStreamingConfigurationInternal mediaStreamingConfiguration) { + public CreateCallRequestInternal setMediaStreamingConfiguration( + MediaStreamingConfigurationInternal mediaStreamingConfiguration) { this.mediaStreamingConfiguration = mediaStreamingConfiguration; return this; } /** * Get the transcriptionConfiguration property: Live Transcription Configuration. - * + * * @return the transcriptionConfiguration value. */ - public TranscriptionConfiguration getTranscriptionConfiguration() { + public TranscriptionConfigurationInternal getTranscriptionConfiguration() { return this.transcriptionConfiguration; } /** * Set the transcriptionConfiguration property: Live Transcription Configuration. - * + * * @param transcriptionConfiguration the transcriptionConfiguration value to set. * @return the CreateCallRequestInternal object itself. */ - public CreateCallRequestInternal - setTranscriptionConfiguration(TranscriptionConfiguration transcriptionConfiguration) { + public CreateCallRequestInternal setTranscriptionConfiguration( + TranscriptionConfigurationInternal transcriptionConfiguration) { this.transcriptionConfiguration = transcriptionConfiguration; return this; } /** * Get the callIntelligenceOptions property: AI options for the call. - * + * * @return the callIntelligenceOptions value. */ public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { @@ -257,19 +248,19 @@ public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { /** * Set the callIntelligenceOptions property: AI options for the call. - * + * * @param callIntelligenceOptions the callIntelligenceOptions value to set. * @return the CreateCallRequestInternal object itself. */ - public CreateCallRequestInternal - setCallIntelligenceOptions(CallIntelligenceOptionsInternal callIntelligenceOptions) { + public CreateCallRequestInternal setCallIntelligenceOptions( + CallIntelligenceOptionsInternal callIntelligenceOptions) { this.callIntelligenceOptions = callIntelligenceOptions; return this; } /** * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @return the customCallingContext value. */ public CustomCallingContext getCustomCallingContext() { @@ -278,7 +269,7 @@ public CustomCallingContext getCustomCallingContext() { /** * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @param customCallingContext the customCallingContext value to set. * @return the CreateCallRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java index 1d6660d121d83..fbcc7207a2e3b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** - * The CustomCallingContext model. - */ +/** The CustomCallingContext model. */ @Fluent public final class CustomCallingContext { /* @@ -25,15 +23,9 @@ public final class CustomCallingContext { @JsonProperty(value = "sipHeaders") private Map sipHeaders; - /** - * Creates an instance of CustomCallingContext class. - */ - public CustomCallingContext() { - } - /** * Get the voipHeaders property: Dictionary of <string>. - * + * * @return the voipHeaders value. */ public Map getVoipHeaders() { @@ -42,7 +34,7 @@ public Map getVoipHeaders() { /** * Set the voipHeaders property: Dictionary of <string>. - * + * * @param voipHeaders the voipHeaders value to set. * @return the CustomCallingContext object itself. */ @@ -53,7 +45,7 @@ public CustomCallingContext setVoipHeaders(Map voipHeaders) { /** * Get the sipHeaders property: Dictionary of <string>. - * + * * @return the sipHeaders value. */ public Map getSipHeaders() { @@ -62,7 +54,7 @@ public Map getSipHeaders() { /** * Set the sipHeaders property: Dictionary of <string>. - * + * * @param sipHeaders the sipHeaders value to set. * @return the CustomCallingContext object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java index fa0e038edf8a8..d97b6fe7408bf 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Determines the type of the dialog. - */ +/** Defines values for DialogInputType. */ public final class DialogInputType extends ExpandableStringEnum { - /** - * Static value powerVirtualAgents for DialogInputType. - */ + /** Static value powerVirtualAgents for DialogInputType. */ public static final DialogInputType POWER_VIRTUAL_AGENTS = fromString("powerVirtualAgents"); - /** - * Static value azureOpenAI for DialogInputType. - */ + /** Static value azureOpenAI for DialogInputType. */ public static final DialogInputType AZURE_OPEN_AI = fromString("azureOpenAI"); - /** - * Creates a new instance of DialogInputType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DialogInputType() { - } - /** * Creates or finds a DialogInputType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DialogInputType. */ @@ -42,11 +27,7 @@ public static DialogInputType fromString(String name) { return fromString(name, DialogInputType.class); } - /** - * Gets known DialogInputType values. - * - * @return known DialogInputType values. - */ + /** @return known DialogInputType values. */ public static Collection values() { return values(DialogInputType.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java index 24f583411b747..2cffa3c2ddd21 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The DialogStateResponse model. - */ +/** The DialogStateResponse model. */ @Fluent public final class DialogStateResponse { /* @@ -30,15 +28,9 @@ public final class DialogStateResponse { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of DialogStateResponse class. - */ - public DialogStateResponse() { - } - /** * Get the dialogId property: The dialog ID. - * + * * @return the dialogId value. */ public String getDialogId() { @@ -47,7 +39,7 @@ public String getDialogId() { /** * Set the dialogId property: The dialog ID. - * + * * @param dialogId the dialogId value to set. * @return the DialogStateResponse object itself. */ @@ -58,7 +50,7 @@ public DialogStateResponse setDialogId(String dialogId) { /** * Get the dialog property: Defines dialog. - * + * * @return the dialog value. */ public BaseDialog getDialog() { @@ -67,7 +59,7 @@ public BaseDialog getDialog() { /** * Set the dialog property: Defines dialog. - * + * * @param dialog the dialog value to set. * @return the DialogStateResponse object itself. */ @@ -78,7 +70,7 @@ public DialogStateResponse setDialog(BaseDialog dialog) { /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -87,7 +79,7 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. * @return the DialogStateResponse object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java index e3be37a00e8d8..afe9020e401ad 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * Options for DTMF recognition. - */ +/** Options for DTMF recognition. */ @Fluent public final class DtmfOptionsInternal { /* @@ -31,15 +29,9 @@ public final class DtmfOptionsInternal { @JsonProperty(value = "stopTones") private List stopTones; - /** - * Creates an instance of DtmfOptionsInternal class. - */ - public DtmfOptionsInternal() { - } - /** * Get the interToneTimeoutInSeconds property: Time to wait between DTMF inputs to stop recognizing. - * + * * @return the interToneTimeoutInSeconds value. */ public Integer getInterToneTimeoutInSeconds() { @@ -48,7 +40,7 @@ public Integer getInterToneTimeoutInSeconds() { /** * Set the interToneTimeoutInSeconds property: Time to wait between DTMF inputs to stop recognizing. - * + * * @param interToneTimeoutInSeconds the interToneTimeoutInSeconds value to set. * @return the DtmfOptionsInternal object itself. */ @@ -59,7 +51,7 @@ public DtmfOptionsInternal setInterToneTimeoutInSeconds(Integer interToneTimeout /** * Get the maxTonesToCollect property: Maximum number of DTMF tones to be collected. - * + * * @return the maxTonesToCollect value. */ public Integer getMaxTonesToCollect() { @@ -68,7 +60,7 @@ public Integer getMaxTonesToCollect() { /** * Set the maxTonesToCollect property: Maximum number of DTMF tones to be collected. - * + * * @param maxTonesToCollect the maxTonesToCollect value to set. * @return the DtmfOptionsInternal object itself. */ @@ -79,7 +71,7 @@ public DtmfOptionsInternal setMaxTonesToCollect(Integer maxTonesToCollect) { /** * Get the stopTones property: List of tones that will stop recognizing. - * + * * @return the stopTones value. */ public List getStopTones() { @@ -88,7 +80,7 @@ public List getStopTones() { /** * Set the stopTones property: List of tones that will stop recognizing. - * + * * @param stopTones the stopTones value to set. * @return the DtmfOptionsInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java index cbcd130d7336c..9c9a60a1a8fa5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DtmfResult model. - */ +/** The DtmfResult model. */ @Immutable public final class DtmfResult { /* @@ -19,15 +17,9 @@ public final class DtmfResult { @JsonProperty(value = "tones", access = JsonProperty.Access.WRITE_ONLY) private List tones; - /** - * Creates an instance of DtmfResult class. - */ - public DtmfResult() { - } - /** * Get the tones property: The tones property. - * + * * @return the tones value. */ public List getTones() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java index 6890aba1ea99b..a948acb7be8b7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java @@ -8,102 +8,59 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines values for DtmfToneInternal. - */ +/** Defines values for DtmfToneInternal. */ public final class DtmfToneInternal extends ExpandableStringEnum { - /** - * Static value zero for DtmfToneInternal. - */ + /** Static value zero for DtmfToneInternal. */ public static final DtmfToneInternal ZERO = fromString("zero"); - /** - * Static value one for DtmfToneInternal. - */ + /** Static value one for DtmfToneInternal. */ public static final DtmfToneInternal ONE = fromString("one"); - /** - * Static value two for DtmfToneInternal. - */ + /** Static value two for DtmfToneInternal. */ public static final DtmfToneInternal TWO = fromString("two"); - /** - * Static value three for DtmfToneInternal. - */ + /** Static value three for DtmfToneInternal. */ public static final DtmfToneInternal THREE = fromString("three"); - /** - * Static value four for DtmfToneInternal. - */ + /** Static value four for DtmfToneInternal. */ public static final DtmfToneInternal FOUR = fromString("four"); - /** - * Static value five for DtmfToneInternal. - */ + /** Static value five for DtmfToneInternal. */ public static final DtmfToneInternal FIVE = fromString("five"); - /** - * Static value six for DtmfToneInternal. - */ + /** Static value six for DtmfToneInternal. */ public static final DtmfToneInternal SIX = fromString("six"); - /** - * Static value seven for DtmfToneInternal. - */ + /** Static value seven for DtmfToneInternal. */ public static final DtmfToneInternal SEVEN = fromString("seven"); - /** - * Static value eight for DtmfToneInternal. - */ + /** Static value eight for DtmfToneInternal. */ public static final DtmfToneInternal EIGHT = fromString("eight"); - /** - * Static value nine for DtmfToneInternal. - */ + /** Static value nine for DtmfToneInternal. */ public static final DtmfToneInternal NINE = fromString("nine"); - /** - * Static value a for DtmfToneInternal. - */ + /** Static value a for DtmfToneInternal. */ public static final DtmfToneInternal A = fromString("a"); - /** - * Static value b for DtmfToneInternal. - */ + /** Static value b for DtmfToneInternal. */ public static final DtmfToneInternal B = fromString("b"); - /** - * Static value c for DtmfToneInternal. - */ + /** Static value c for DtmfToneInternal. */ public static final DtmfToneInternal C = fromString("c"); - /** - * Static value d for DtmfToneInternal. - */ + /** Static value d for DtmfToneInternal. */ public static final DtmfToneInternal D = fromString("d"); - /** - * Static value pound for DtmfToneInternal. - */ + /** Static value pound for DtmfToneInternal. */ public static final DtmfToneInternal POUND = fromString("pound"); - /** - * Static value asterisk for DtmfToneInternal. - */ + /** Static value asterisk for DtmfToneInternal. */ public static final DtmfToneInternal ASTERISK = fromString("asterisk"); - /** - * Creates a new instance of DtmfToneInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DtmfToneInternal() { - } - /** * Creates or finds a DtmfToneInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding DtmfToneInternal. */ @@ -112,11 +69,7 @@ public static DtmfToneInternal fromString(String name) { return fromString(name, DtmfToneInternal.class); } - /** - * Gets known DtmfToneInternal values. - * - * @return known DtmfToneInternal values. - */ + /** @return known DtmfToneInternal values. */ public static Collection values() { return values(DtmfToneInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java index eea244c9fd018..da8b5480e1d6e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The ExternalStorageInternal model. - */ +/** The ExternalStorageInternal model. */ @Fluent public final class ExternalStorageInternal { /* @@ -24,15 +22,9 @@ public final class ExternalStorageInternal { @JsonProperty(value = "blobStorage") private BlobStorageInternal blobStorage; - /** - * Creates an instance of ExternalStorageInternal class. - */ - public ExternalStorageInternal() { - } - /** * Get the storageType property: Defines the type of external storage. - * + * * @return the storageType value. */ public RecordingStorageTypeInternal getStorageType() { @@ -41,7 +33,7 @@ public RecordingStorageTypeInternal getStorageType() { /** * Set the storageType property: Defines the type of external storage. - * + * * @param storageType the storageType value to set. * @return the ExternalStorageInternal object itself. */ @@ -52,7 +44,7 @@ public ExternalStorageInternal setStorageType(RecordingStorageTypeInternal stora /** * Get the blobStorage property: Defines the blob storage location where the recording will be stored. - * + * * @return the blobStorage value. */ public BlobStorageInternal getBlobStorage() { @@ -61,7 +53,7 @@ public BlobStorageInternal getBlobStorage() { /** * Set the blobStorage property: Defines the blob storage location where the recording will be stored. - * + * * @param blobStorage the blobStorage value to set. * @return the ExternalStorageInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java index 1393f553751a6..e59e9464a3b20 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The FileSourceInternal model. - */ +/** The FileSourceInternal model. */ @Fluent public final class FileSourceInternal { /* @@ -18,15 +16,9 @@ public final class FileSourceInternal { @JsonProperty(value = "uri", required = true) private String uri; - /** - * Creates an instance of FileSourceInternal class. - */ - public FileSourceInternal() { - } - /** * Get the uri property: Uri for the audio file to be played. - * + * * @return the uri value. */ public String getUri() { @@ -35,7 +27,7 @@ public String getUri() { /** * Set the uri property: Uri for the audio file to be played. - * + * * @param uri the uri value to set. * @return the FileSourceInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java index d46f7c71efa65..92f47566dd3ed 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The response payload for getting participants of the call. - */ +/** The response payload for getting participants of the call. */ @Fluent public final class GetParticipantsResponseInternal { /* @@ -25,15 +23,9 @@ public final class GetParticipantsResponseInternal { @JsonProperty(value = "nextLink") private String nextLink; - /** - * Creates an instance of GetParticipantsResponseInternal class. - */ - public GetParticipantsResponseInternal() { - } - /** * Get the value property: List of the current participants in the call. - * + * * @return the value value. */ public List getValue() { @@ -42,7 +34,7 @@ public List getValue() { /** * Set the value property: List of the current participants in the call. - * + * * @param value the value value to set. * @return the GetParticipantsResponseInternal object itself. */ @@ -53,7 +45,7 @@ public GetParticipantsResponseInternal setValue(List va /** * Get the nextLink property: Continue of the list of participants. - * + * * @return the nextLink value. */ public String getNextLink() { @@ -62,7 +54,7 @@ public String getNextLink() { /** * Set the nextLink property: Continue of the list of participants. - * + * * @param nextLink the nextLink value to set. * @return the GetParticipantsResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java index 18be50f3a5f64..f953410cea3b7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java @@ -8,33 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Audio channel type to stream, eg. unmixed audio, mixed audio. - */ +/** Defines values for MediaStreamingAudioChannelTypeInternal. */ public final class MediaStreamingAudioChannelTypeInternal - extends ExpandableStringEnum { - /** - * Static value mixed for MediaStreamingAudioChannelTypeInternal. - */ + extends ExpandableStringEnum { + /** Static value mixed for MediaStreamingAudioChannelTypeInternal. */ public static final MediaStreamingAudioChannelTypeInternal MIXED = fromString("mixed"); - /** - * Static value unmixed for MediaStreamingAudioChannelTypeInternal. - */ + /** Static value unmixed for MediaStreamingAudioChannelTypeInternal. */ public static final MediaStreamingAudioChannelTypeInternal UNMIXED = fromString("unmixed"); - /** - * Creates a new instance of MediaStreamingAudioChannelTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MediaStreamingAudioChannelTypeInternal() { - } - /** * Creates or finds a MediaStreamingAudioChannelTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding MediaStreamingAudioChannelTypeInternal. */ @@ -43,11 +28,7 @@ public static MediaStreamingAudioChannelTypeInternal fromString(String name) { return fromString(name, MediaStreamingAudioChannelTypeInternal.class); } - /** - * Gets known MediaStreamingAudioChannelTypeInternal values. - * - * @return known MediaStreamingAudioChannelTypeInternal values. - */ + /** @return known MediaStreamingAudioChannelTypeInternal values. */ public static Collection values() { return values(MediaStreamingAudioChannelTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java index 8c57847ad0994..54956c4119315 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Configuration of Media streaming. - */ +/** Configuration of Media streaming. */ @Fluent public final class MediaStreamingConfigurationInternal { /* @@ -36,15 +34,9 @@ public final class MediaStreamingConfigurationInternal { @JsonProperty(value = "audioChannelType", required = true) private MediaStreamingAudioChannelTypeInternal audioChannelType; - /** - * Creates an instance of MediaStreamingConfigurationInternal class. - */ - public MediaStreamingConfigurationInternal() { - } - /** * Get the transportUrl property: Transport URL for media streaming. - * + * * @return the transportUrl value. */ public String getTransportUrl() { @@ -53,7 +45,7 @@ public String getTransportUrl() { /** * Set the transportUrl property: Transport URL for media streaming. - * + * * @param transportUrl the transportUrl value to set. * @return the MediaStreamingConfigurationInternal object itself. */ @@ -64,7 +56,7 @@ public MediaStreamingConfigurationInternal setTransportUrl(String transportUrl) /** * Get the transportType property: The type of transport to be used for media streaming, eg. Websocket. - * + * * @return the transportType value. */ public MediaStreamingTransportTypeInternal getTransportType() { @@ -73,7 +65,7 @@ public MediaStreamingTransportTypeInternal getTransportType() { /** * Set the transportType property: The type of transport to be used for media streaming, eg. Websocket. - * + * * @param transportType the transportType value to set. * @return the MediaStreamingConfigurationInternal object itself. */ @@ -84,7 +76,7 @@ public MediaStreamingConfigurationInternal setTransportType(MediaStreamingTransp /** * Get the contentType property: Content type to stream, eg. audio, audio/video. - * + * * @return the contentType value. */ public MediaStreamingContentTypeInternal getContentType() { @@ -93,7 +85,7 @@ public MediaStreamingContentTypeInternal getContentType() { /** * Set the contentType property: Content type to stream, eg. audio, audio/video. - * + * * @param contentType the contentType value to set. * @return the MediaStreamingConfigurationInternal object itself. */ @@ -104,7 +96,7 @@ public MediaStreamingConfigurationInternal setContentType(MediaStreamingContentT /** * Get the audioChannelType property: Audio channel type to stream, eg. unmixed audio, mixed audio. - * + * * @return the audioChannelType value. */ public MediaStreamingAudioChannelTypeInternal getAudioChannelType() { @@ -113,12 +105,12 @@ public MediaStreamingAudioChannelTypeInternal getAudioChannelType() { /** * Set the audioChannelType property: Audio channel type to stream, eg. unmixed audio, mixed audio. - * + * * @param audioChannelType the audioChannelType value to set. * @return the MediaStreamingConfigurationInternal object itself. */ - public MediaStreamingConfigurationInternal - setAudioChannelType(MediaStreamingAudioChannelTypeInternal audioChannelType) { + public MediaStreamingConfigurationInternal setAudioChannelType( + MediaStreamingAudioChannelTypeInternal audioChannelType) { this.audioChannelType = audioChannelType; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java index 8f4a8b549571c..1554ea125e581 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java @@ -8,27 +8,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Content type to stream, eg. audio, audio/video. - */ +/** Defines values for MediaStreamingContentTypeInternal. */ public final class MediaStreamingContentTypeInternal extends ExpandableStringEnum { - /** - * Static value audio for MediaStreamingContentTypeInternal. - */ + /** Static value audio for MediaStreamingContentTypeInternal. */ public static final MediaStreamingContentTypeInternal AUDIO = fromString("audio"); - /** - * Creates a new instance of MediaStreamingContentTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MediaStreamingContentTypeInternal() { - } - /** * Creates or finds a MediaStreamingContentTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding MediaStreamingContentTypeInternal. */ @@ -37,11 +24,7 @@ public static MediaStreamingContentTypeInternal fromString(String name) { return fromString(name, MediaStreamingContentTypeInternal.class); } - /** - * Gets known MediaStreamingContentTypeInternal values. - * - * @return known MediaStreamingContentTypeInternal values. - */ + /** @return known MediaStreamingContentTypeInternal values. */ public static Collection values() { return values(MediaStreamingContentTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java index 4b1af17c27534..4bad8f6a8d5ca 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java @@ -8,28 +8,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The type of transport to be used for media streaming, eg. Websocket. - */ +/** Defines values for MediaStreamingTransportTypeInternal. */ public final class MediaStreamingTransportTypeInternal - extends ExpandableStringEnum { - /** - * Static value websocket for MediaStreamingTransportTypeInternal. - */ + extends ExpandableStringEnum { + /** Static value websocket for MediaStreamingTransportTypeInternal. */ public static final MediaStreamingTransportTypeInternal WEBSOCKET = fromString("websocket"); - /** - * Creates a new instance of MediaStreamingTransportTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MediaStreamingTransportTypeInternal() { - } - /** * Creates or finds a MediaStreamingTransportTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding MediaStreamingTransportTypeInternal. */ @@ -38,11 +25,7 @@ public static MediaStreamingTransportTypeInternal fromString(String name) { return fromString(name, MediaStreamingTransportTypeInternal.class); } - /** - * Gets known MediaStreamingTransportTypeInternal values. - * - * @return known MediaStreamingTransportTypeInternal values. - */ + /** @return known MediaStreamingTransportTypeInternal values. */ public static Collection values() { return values(MediaStreamingTransportTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java index 0ec4fb456bbc0..3ae62106d1a72 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java @@ -7,39 +7,34 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * A Microsoft Teams user. - */ +/** A Microsoft Teams user. */ @Fluent public final class MicrosoftTeamsUserIdentifierModel { /* - * The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. + * The Id of the Microsoft Teams user. If not anonymous, this is the AAD + * object Id of the user. */ @JsonProperty(value = "userId", required = true) private String userId; /* - * True if the Microsoft Teams user is anonymous. By default false if missing. + * True if the Microsoft Teams user is anonymous. By default false if + * missing. */ @JsonProperty(value = "isAnonymous") private Boolean isAnonymous; /* - * The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. + * The cloud that the Microsoft Teams user belongs to. By default 'public' + * if missing. */ @JsonProperty(value = "cloud") private CommunicationCloudEnvironmentModel cloud; - /** - * Creates an instance of MicrosoftTeamsUserIdentifierModel class. - */ - public MicrosoftTeamsUserIdentifierModel() { - } - /** * Get the userId property: The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the * user. - * + * * @return the userId value. */ public String getUserId() { @@ -49,7 +44,7 @@ public String getUserId() { /** * Set the userId property: The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the * user. - * + * * @param userId the userId value to set. * @return the MicrosoftTeamsUserIdentifierModel object itself. */ @@ -60,7 +55,7 @@ public MicrosoftTeamsUserIdentifierModel setUserId(String userId) { /** * Get the isAnonymous property: True if the Microsoft Teams user is anonymous. By default false if missing. - * + * * @return the isAnonymous value. */ public Boolean isAnonymous() { @@ -69,7 +64,7 @@ public Boolean isAnonymous() { /** * Set the isAnonymous property: True if the Microsoft Teams user is anonymous. By default false if missing. - * + * * @param isAnonymous the isAnonymous value to set. * @return the MicrosoftTeamsUserIdentifierModel object itself. */ @@ -80,7 +75,7 @@ public MicrosoftTeamsUserIdentifierModel setIsAnonymous(Boolean isAnonymous) { /** * Get the cloud property: The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. - * + * * @return the cloud value. */ public CommunicationCloudEnvironmentModel getCloud() { @@ -89,7 +84,7 @@ public CommunicationCloudEnvironmentModel getCloud() { /** * Set the cloud property: The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. - * + * * @param cloud the cloud value to set. * @return the MicrosoftTeamsUserIdentifierModel object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java index 76ce2d226c62d..3fbc9406dee8f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The request payload for muting participants from the call. - */ +/** The request payload for muting participants from the call. */ @Fluent public final class MuteParticipantsRequestInternal { /* @@ -21,21 +19,15 @@ public final class MuteParticipantsRequestInternal { private List targetParticipants; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /** - * Creates an instance of MuteParticipantsRequestInternal class. - */ - public MuteParticipantsRequestInternal() { - } - - /** - * Get the targetParticipants property: Participants to be muted from the call. - * Only ACS Users are supported. - * + * Get the targetParticipants property: Participants to be muted from the call. Only ACS Users are supported. + * * @return the targetParticipants value. */ public List getTargetParticipants() { @@ -43,14 +35,13 @@ public List getTargetParticipants() { } /** - * Set the targetParticipants property: Participants to be muted from the call. - * Only ACS Users are supported. - * + * Set the targetParticipants property: Participants to be muted from the call. Only ACS Users are supported. + * * @param targetParticipants the targetParticipants value to set. * @return the MuteParticipantsRequestInternal object itself. */ - public MuteParticipantsRequestInternal - setTargetParticipants(List targetParticipants) { + public MuteParticipantsRequestInternal setTargetParticipants( + List targetParticipants) { this.targetParticipants = targetParticipants; return this; } @@ -58,7 +49,7 @@ public List getTargetParticipants() { /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -68,7 +59,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the MuteParticipantsRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java index bd40099aa64dc..44b6504cbc8d1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The result payload for muting participants from the call. - */ +/** The result payload for muting participants from the call. */ @Fluent public final class MuteParticipantsResultInternal { /* @@ -18,15 +16,9 @@ public final class MuteParticipantsResultInternal { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of MuteParticipantsResultInternal class. - */ - public MuteParticipantsResultInternal() { - } - /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -35,7 +27,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the MuteParticipantsResultInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java index 0e6e5482a869d..29e7e249daa50 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * A phone number. - */ +/** A phone number. */ @Fluent public final class PhoneNumberIdentifierModel { /* @@ -18,15 +16,9 @@ public final class PhoneNumberIdentifierModel { @JsonProperty(value = "value", required = true) private String value; - /** - * Creates an instance of PhoneNumberIdentifierModel class. - */ - public PhoneNumberIdentifierModel() { - } - /** * Get the value property: The phone number in E.164 format. - * + * * @return the value value. */ public String getValue() { @@ -35,7 +27,7 @@ public String getValue() { /** * Set the value property: The phone number in E.164 format. - * + * * @param value the value value to set. * @return the PhoneNumberIdentifierModel object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java index 9ebf0115fd407..60b1f526769e9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The PlayOptionsInternal model. - */ +/** The PlayOptionsInternal model. */ @Fluent public final class PlayOptionsInternal { /* @@ -18,15 +16,9 @@ public final class PlayOptionsInternal { @JsonProperty(value = "loop", required = true) private boolean loop; - /** - * Creates an instance of PlayOptionsInternal class. - */ - public PlayOptionsInternal() { - } - /** * Get the loop property: The option to play the provided audio source in loop when set to true. - * + * * @return the loop value. */ public boolean isLoop() { @@ -35,7 +27,7 @@ public boolean isLoop() { /** * Set the loop property: The option to play the provided audio source in loop when set to true. - * + * * @param loop the loop value to set. * @return the PlayOptionsInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java index 59e89b8baf1ae..87c70649e21ce 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The PlayRequest model. - */ +/** The PlayRequest model. */ @Fluent public final class PlayRequest { /* @@ -39,22 +37,17 @@ public final class PlayRequest { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of PlayRequest class. - */ - public PlayRequest() { - } - /** * Get the playSources property: The source of the audio to be played. - * + * * @return the playSources value. */ public List getPlaySources() { @@ -63,7 +56,7 @@ public List getPlaySources() { /** * Set the playSources property: The source of the audio to be played. - * + * * @param playSources the playSources value to set. * @return the PlayRequest object itself. */ @@ -73,9 +66,9 @@ public PlayRequest setPlaySources(List playSources) { } /** - * Get the playTo property: The list of call participants play provided audio to. - * Plays to everyone in the call when not provided. - * + * Get the playTo property: The list of call participants play provided audio to. Plays to everyone in the call when + * not provided. + * * @return the playTo value. */ public List getPlayTo() { @@ -83,9 +76,9 @@ public List getPlayTo() { } /** - * Set the playTo property: The list of call participants play provided audio to. - * Plays to everyone in the call when not provided. - * + * Set the playTo property: The list of call participants play provided audio to. Plays to everyone in the call when + * not provided. + * * @param playTo the playTo value to set. * @return the PlayRequest object itself. */ @@ -96,7 +89,7 @@ public PlayRequest setPlayTo(List playTo) { /** * Get the playOptions property: Defines options for playing the audio. - * + * * @return the playOptions value. */ public PlayOptionsInternal getPlayOptions() { @@ -105,7 +98,7 @@ public PlayOptionsInternal getPlayOptions() { /** * Set the playOptions property: Defines options for playing the audio. - * + * * @param playOptions the playOptions value to set. * @return the PlayRequest object itself. */ @@ -116,7 +109,7 @@ public PlayRequest setPlayOptions(PlayOptionsInternal playOptions) { /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -125,7 +118,7 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. * @return the PlayRequest object itself. */ @@ -136,10 +129,9 @@ public PlayRequest setOperationContext(String operationContext) { /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -148,10 +140,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the PlayRequest object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java index 4fa917e2c03cd..1d112f984aa78 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The PlaySourceInternal model. - */ +/** The PlaySourceInternal model. */ @Fluent public final class PlaySourceInternal { /* @@ -37,20 +35,15 @@ public final class PlaySourceInternal { private TextSourceInternal text; /* - * Defines the ssml(Speech Synthesis Markup Language) source info to be used for play + * Defines the ssml(Speech Synthesis Markup Language) source info to be + * used for play */ @JsonProperty(value = "ssml") private SsmlSourceInternal ssml; - /** - * Creates an instance of PlaySourceInternal class. - */ - public PlaySourceInternal() { - } - /** * Get the kind property: Defines the type of the play source. - * + * * @return the kind value. */ public PlaySourceTypeInternal getKind() { @@ -59,7 +52,7 @@ public PlaySourceTypeInternal getKind() { /** * Set the kind property: Defines the type of the play source. - * + * * @param kind the kind value to set. * @return the PlaySourceInternal object itself. */ @@ -70,7 +63,7 @@ public PlaySourceInternal setKind(PlaySourceTypeInternal kind) { /** * Get the playSourceCacheId property: Defines the identifier to be used for caching related media. - * + * * @return the playSourceCacheId value. */ public String getPlaySourceCacheId() { @@ -79,7 +72,7 @@ public String getPlaySourceCacheId() { /** * Set the playSourceCacheId property: Defines the identifier to be used for caching related media. - * + * * @param playSourceCacheId the playSourceCacheId value to set. * @return the PlaySourceInternal object itself. */ @@ -90,7 +83,7 @@ public PlaySourceInternal setPlaySourceCacheId(String playSourceCacheId) { /** * Get the file property: Defines the file source info to be used for play. - * + * * @return the file value. */ public FileSourceInternal getFile() { @@ -99,7 +92,7 @@ public FileSourceInternal getFile() { /** * Set the file property: Defines the file source info to be used for play. - * + * * @param file the file value to set. * @return the PlaySourceInternal object itself. */ @@ -110,7 +103,7 @@ public PlaySourceInternal setFile(FileSourceInternal file) { /** * Get the text property: Defines the text source info to be used for play. - * + * * @return the text value. */ public TextSourceInternal getText() { @@ -119,7 +112,7 @@ public TextSourceInternal getText() { /** * Set the text property: Defines the text source info to be used for play. - * + * * @param text the text value to set. * @return the PlaySourceInternal object itself. */ @@ -130,7 +123,7 @@ public PlaySourceInternal setText(TextSourceInternal text) { /** * Get the ssml property: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. - * + * * @return the ssml value. */ public SsmlSourceInternal getSsml() { @@ -139,7 +132,7 @@ public SsmlSourceInternal getSsml() { /** * Set the ssml property: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. - * + * * @param ssml the ssml value to set. * @return the PlaySourceInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java index 69e9b3b6c050b..e94d5afd03203 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java @@ -8,37 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines the type of the play source. - */ +/** Defines values for PlaySourceTypeInternal. */ public final class PlaySourceTypeInternal extends ExpandableStringEnum { - /** - * Static value file for PlaySourceTypeInternal. - */ + /** Static value file for PlaySourceTypeInternal. */ public static final PlaySourceTypeInternal FILE = fromString("file"); - /** - * Static value text for PlaySourceTypeInternal. - */ + /** Static value text for PlaySourceTypeInternal. */ public static final PlaySourceTypeInternal TEXT = fromString("text"); - /** - * Static value ssml for PlaySourceTypeInternal. - */ + /** Static value ssml for PlaySourceTypeInternal. */ public static final PlaySourceTypeInternal SSML = fromString("ssml"); - /** - * Creates a new instance of PlaySourceTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PlaySourceTypeInternal() { - } - /** * Creates or finds a PlaySourceTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding PlaySourceTypeInternal. */ @@ -47,11 +30,7 @@ public static PlaySourceTypeInternal fromString(String name) { return fromString(name, PlaySourceTypeInternal.class); } - /** - * Gets known PlaySourceTypeInternal values. - * - * @return known PlaySourceTypeInternal values. - */ + /** @return known PlaySourceTypeInternal values. */ public static Collection values() { return values(PlaySourceTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java index 813b78b1043c8..945a109bf0d2d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java @@ -8,11 +8,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; -/** - * Power Virtual Agents Dialog. - */ +/** Power Virtual Agents Dialog. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("PowerVirtualAgents") @Fluent @@ -29,15 +26,9 @@ public final class PowerVirtualAgentsDialog extends BaseDialog { @JsonProperty(value = "language") private String language; - /** - * Creates an instance of PowerVirtualAgentsDialog class. - */ - public PowerVirtualAgentsDialog() { - } - /** * Get the botAppId property: Bot identifier. - * + * * @return the botAppId value. */ public String getBotAppId() { @@ -46,7 +37,7 @@ public String getBotAppId() { /** * Set the botAppId property: Bot identifier. - * + * * @param botAppId the botAppId value to set. * @return the PowerVirtualAgentsDialog object itself. */ @@ -57,7 +48,7 @@ public PowerVirtualAgentsDialog setBotAppId(String botAppId) { /** * Get the language property: Language. - * + * * @return the language value. */ public String getLanguage() { @@ -66,7 +57,7 @@ public String getLanguage() { /** * Set the language property: Language. - * + * * @param language the language value to set. * @return the PowerVirtualAgentsDialog object itself. */ @@ -74,13 +65,4 @@ public PowerVirtualAgentsDialog setLanguage(String language) { this.language = language; return this; } - - /** - * {@inheritDoc} - */ - @Override - public PowerVirtualAgentsDialog setContext(Map context) { - super.setContext(context); - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java index a8f280e95c2c5..d2a9670793845 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The RecognitionChoiceInternal model. - */ +/** The RecognitionChoiceInternal model. */ @Fluent public final class RecognitionChoiceInternal { /* @@ -31,15 +29,9 @@ public final class RecognitionChoiceInternal { @JsonProperty(value = "tone") private DtmfToneInternal tone; - /** - * Creates an instance of RecognitionChoiceInternal class. - */ - public RecognitionChoiceInternal() { - } - /** * Get the label property: Identifier for a given choice. - * + * * @return the label value. */ public String getLabel() { @@ -48,7 +40,7 @@ public String getLabel() { /** * Set the label property: Identifier for a given choice. - * + * * @param label the label value to set. * @return the RecognitionChoiceInternal object itself. */ @@ -59,7 +51,7 @@ public RecognitionChoiceInternal setLabel(String label) { /** * Get the phrases property: List of phrases to recognize. - * + * * @return the phrases value. */ public List getPhrases() { @@ -68,7 +60,7 @@ public List getPhrases() { /** * Set the phrases property: List of phrases to recognize. - * + * * @param phrases the phrases value to set. * @return the RecognitionChoiceInternal object itself. */ @@ -79,7 +71,7 @@ public RecognitionChoiceInternal setPhrases(List phrases) { /** * Get the tone property: The tone property. - * + * * @return the tone value. */ public DtmfToneInternal getTone() { @@ -88,7 +80,7 @@ public DtmfToneInternal getTone() { /** * Set the tone property: The tone property. - * + * * @param tone the tone value to set. * @return the RecognitionChoiceInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java index e555a1bdf52da..cc38c2393bf33 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java @@ -8,38 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Determines the sub-type of the recognize operation. - * In case of cancel operation the this field is not set and is returned empty. - */ +/** Defines values for RecognitionTypeInternal. */ public final class RecognitionTypeInternal extends ExpandableStringEnum { - /** - * Static value dtmf for RecognitionTypeInternal. - */ + /** Static value dtmf for RecognitionTypeInternal. */ public static final RecognitionTypeInternal DTMF = fromString("dtmf"); - /** - * Static value speech for RecognitionTypeInternal. - */ + /** Static value speech for RecognitionTypeInternal. */ public static final RecognitionTypeInternal SPEECH = fromString("speech"); - /** - * Static value choices for RecognitionTypeInternal. - */ + /** Static value choices for RecognitionTypeInternal. */ public static final RecognitionTypeInternal CHOICES = fromString("choices"); - /** - * Creates a new instance of RecognitionTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecognitionTypeInternal() { - } - /** * Creates or finds a RecognitionTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecognitionTypeInternal. */ @@ -48,11 +30,7 @@ public static RecognitionTypeInternal fromString(String name) { return fromString(name, RecognitionTypeInternal.class); } - /** - * Gets known RecognitionTypeInternal values. - * - * @return known RecognitionTypeInternal values. - */ + /** @return known RecognitionTypeInternal values. */ public static Collection values() { return values(RecognitionTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java index a6ae0ecb3b2bc..9ec0961787ef5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java @@ -8,42 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Determines the type of the recognition. - */ +/** Defines values for RecognizeInputTypeInternal. */ public final class RecognizeInputTypeInternal extends ExpandableStringEnum { - /** - * Static value dtmf for RecognizeInputTypeInternal. - */ + /** Static value dtmf for RecognizeInputTypeInternal. */ public static final RecognizeInputTypeInternal DTMF = fromString("dtmf"); - /** - * Static value speech for RecognizeInputTypeInternal. - */ + /** Static value speech for RecognizeInputTypeInternal. */ public static final RecognizeInputTypeInternal SPEECH = fromString("speech"); - /** - * Static value speechOrDtmf for RecognizeInputTypeInternal. - */ + /** Static value speechOrDtmf for RecognizeInputTypeInternal. */ public static final RecognizeInputTypeInternal SPEECH_OR_DTMF = fromString("speechOrDtmf"); - /** - * Static value choices for RecognizeInputTypeInternal. - */ + /** Static value choices for RecognizeInputTypeInternal. */ public static final RecognizeInputTypeInternal CHOICES = fromString("choices"); - /** - * Creates a new instance of RecognizeInputTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecognizeInputTypeInternal() { - } - /** * Creates or finds a RecognizeInputTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecognizeInputTypeInternal. */ @@ -52,11 +33,7 @@ public static RecognizeInputTypeInternal fromString(String name) { return fromString(name, RecognizeInputTypeInternal.class); } - /** - * Gets known RecognizeInputTypeInternal values. - * - * @return known RecognizeInputTypeInternal values. - */ + /** @return known RecognizeInputTypeInternal values. */ public static Collection values() { return values(RecognizeInputTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java index e40542be2e740..a2aebfd1dabf6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The RecognizeOptionsInternal model. - */ +/** The RecognizeOptionsInternal model. */ @Fluent public final class RecognizeOptionsInternal { /* @@ -61,15 +59,9 @@ public final class RecognizeOptionsInternal { @JsonProperty(value = "speechOptions") private SpeechOptionsInternal speechOptions; - /** - * Creates an instance of RecognizeOptionsInternal class. - */ - public RecognizeOptionsInternal() { - } - /** * Get the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. - * + * * @return the interruptPrompt value. */ public Boolean isInterruptPrompt() { @@ -78,7 +70,7 @@ public Boolean isInterruptPrompt() { /** * Set the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. - * + * * @param interruptPrompt the interruptPrompt value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -89,7 +81,7 @@ public RecognizeOptionsInternal setInterruptPrompt(Boolean interruptPrompt) { /** * Get the initialSilenceTimeoutInSeconds property: Time to wait for first input after prompt (if any). - * + * * @return the initialSilenceTimeoutInSeconds value. */ public Integer getInitialSilenceTimeoutInSeconds() { @@ -98,7 +90,7 @@ public Integer getInitialSilenceTimeoutInSeconds() { /** * Set the initialSilenceTimeoutInSeconds property: Time to wait for first input after prompt (if any). - * + * * @param initialSilenceTimeoutInSeconds the initialSilenceTimeoutInSeconds value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -109,7 +101,7 @@ public RecognizeOptionsInternal setInitialSilenceTimeoutInSeconds(Integer initia /** * Get the targetParticipant property: Target participant of DTMF tone recognition. - * + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -118,7 +110,7 @@ public CommunicationIdentifierModel getTargetParticipant() { /** * Set the targetParticipant property: Target participant of DTMF tone recognition. - * + * * @param targetParticipant the targetParticipant value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -129,7 +121,7 @@ public RecognizeOptionsInternal setTargetParticipant(CommunicationIdentifierMode /** * Get the speechLanguage property: Speech language to be recognized, If not set default is en-US. - * + * * @return the speechLanguage value. */ public String getSpeechLanguage() { @@ -138,7 +130,7 @@ public String getSpeechLanguage() { /** * Set the speechLanguage property: Speech language to be recognized, If not set default is en-US. - * + * * @param speechLanguage the speechLanguage value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -149,7 +141,7 @@ public RecognizeOptionsInternal setSpeechLanguage(String speechLanguage) { /** * Get the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. - * + * * @return the speechRecognitionModelEndpointId value. */ public String getSpeechRecognitionModelEndpointId() { @@ -158,7 +150,7 @@ public String getSpeechRecognitionModelEndpointId() { /** * Set the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. - * + * * @param speechRecognitionModelEndpointId the speechRecognitionModelEndpointId value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -169,7 +161,7 @@ public RecognizeOptionsInternal setSpeechRecognitionModelEndpointId(String speec /** * Get the dtmfOptions property: Defines configurations for DTMF. - * + * * @return the dtmfOptions value. */ public DtmfOptionsInternal getDtmfOptions() { @@ -178,7 +170,7 @@ public DtmfOptionsInternal getDtmfOptions() { /** * Set the dtmfOptions property: Defines configurations for DTMF. - * + * * @param dtmfOptions the dtmfOptions value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -189,7 +181,7 @@ public RecognizeOptionsInternal setDtmfOptions(DtmfOptionsInternal dtmfOptions) /** * Get the choices property: Defines Ivr choices for recognize. - * + * * @return the choices value. */ public List getChoices() { @@ -198,7 +190,7 @@ public List getChoices() { /** * Set the choices property: Defines Ivr choices for recognize. - * + * * @param choices the choices value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -209,7 +201,7 @@ public RecognizeOptionsInternal setChoices(List choic /** * Get the speechOptions property: Defines continuous speech recognition option. - * + * * @return the speechOptions value. */ public SpeechOptionsInternal getSpeechOptions() { @@ -218,7 +210,7 @@ public SpeechOptionsInternal getSpeechOptions() { /** * Set the speechOptions property: Defines continuous speech recognition option. - * + * * @param speechOptions the speechOptions value to set. * @return the RecognizeOptionsInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java index 3886e69a20516..f0dbaa776d17a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The RecognizeRequest model. - */ +/** The RecognizeRequest model. */ @Fluent public final class RecognizeRequest { /* @@ -25,7 +23,8 @@ public final class RecognizeRequest { private PlaySourceInternal playPrompt; /* - * If set recognize can barge into other existing queued-up/currently-processing requests. + * If set recognize can barge into other existing + * queued-up/currently-processing requests. */ @JsonProperty(value = "interruptCallMediaOperation") private Boolean interruptCallMediaOperation; @@ -43,22 +42,17 @@ public final class RecognizeRequest { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of RecognizeRequest class. - */ - public RecognizeRequest() { - } - /** * Get the recognizeInputType property: Determines the type of the recognition. - * + * * @return the recognizeInputType value. */ public RecognizeInputTypeInternal getRecognizeInputType() { @@ -67,7 +61,7 @@ public RecognizeInputTypeInternal getRecognizeInputType() { /** * Set the recognizeInputType property: Determines the type of the recognition. - * + * * @param recognizeInputType the recognizeInputType value to set. * @return the RecognizeRequest object itself. */ @@ -78,7 +72,7 @@ public RecognizeRequest setRecognizeInputType(RecognizeInputTypeInternal recogni /** * Get the playPrompt property: The source of the audio to be played for recognition. - * + * * @return the playPrompt value. */ public PlaySourceInternal getPlayPrompt() { @@ -87,7 +81,7 @@ public PlaySourceInternal getPlayPrompt() { /** * Set the playPrompt property: The source of the audio to be played for recognition. - * + * * @param playPrompt the playPrompt value to set. * @return the RecognizeRequest object itself. */ @@ -99,7 +93,7 @@ public RecognizeRequest setPlayPrompt(PlaySourceInternal playPrompt) { /** * Get the interruptCallMediaOperation property: If set recognize can barge into other existing * queued-up/currently-processing requests. - * + * * @return the interruptCallMediaOperation value. */ public Boolean isInterruptCallMediaOperation() { @@ -109,7 +103,7 @@ public Boolean isInterruptCallMediaOperation() { /** * Set the interruptCallMediaOperation property: If set recognize can barge into other existing * queued-up/currently-processing requests. - * + * * @param interruptCallMediaOperation the interruptCallMediaOperation value to set. * @return the RecognizeRequest object itself. */ @@ -120,7 +114,7 @@ public RecognizeRequest setInterruptCallMediaOperation(Boolean interruptCallMedi /** * Get the recognizeOptions property: Defines options for recognition. - * + * * @return the recognizeOptions value. */ public RecognizeOptionsInternal getRecognizeOptions() { @@ -129,7 +123,7 @@ public RecognizeOptionsInternal getRecognizeOptions() { /** * Set the recognizeOptions property: Defines options for recognition. - * + * * @param recognizeOptions the recognizeOptions value to set. * @return the RecognizeRequest object itself. */ @@ -140,7 +134,7 @@ public RecognizeRequest setRecognizeOptions(RecognizeOptionsInternal recognizeOp /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -149,7 +143,7 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. * @return the RecognizeRequest object itself. */ @@ -160,10 +154,9 @@ public RecognizeRequest setOperationContext(String operationContext) { /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -172,10 +165,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the RecognizeRequest object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java index ae6e4efafaea7..7bc685488a2a5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The channel type of call recording. - */ +/** Defines values for RecordingChannelInternal. */ public final class RecordingChannelInternal extends ExpandableStringEnum { - /** - * Static value mixed for RecordingChannelInternal. - */ + /** Static value mixed for RecordingChannelInternal. */ public static final RecordingChannelInternal MIXED = fromString("mixed"); - /** - * Static value unmixed for RecordingChannelInternal. - */ + /** Static value unmixed for RecordingChannelInternal. */ public static final RecordingChannelInternal UNMIXED = fromString("unmixed"); - /** - * Creates a new instance of RecordingChannelInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingChannelInternal() { - } - /** * Creates or finds a RecordingChannelInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingChannelInternal. */ @@ -42,11 +27,7 @@ public static RecordingChannelInternal fromString(String name) { return fromString(name, RecordingChannelInternal.class); } - /** - * Gets known RecordingChannelInternal values. - * - * @return known RecordingChannelInternal values. - */ + /** @return known RecordingChannelInternal values. */ public static Collection values() { return values(RecordingChannelInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java index e217adf395b7d..929ba38b8cffc 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The content type of call recording. - */ +/** Defines values for RecordingContentInternal. */ public final class RecordingContentInternal extends ExpandableStringEnum { - /** - * Static value audio for RecordingContentInternal. - */ + /** Static value audio for RecordingContentInternal. */ public static final RecordingContentInternal AUDIO = fromString("audio"); - /** - * Static value audioVideo for RecordingContentInternal. - */ + /** Static value audioVideo for RecordingContentInternal. */ public static final RecordingContentInternal AUDIO_VIDEO = fromString("audioVideo"); - /** - * Creates a new instance of RecordingContentInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingContentInternal() { - } - /** * Creates or finds a RecordingContentInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingContentInternal. */ @@ -42,11 +27,7 @@ public static RecordingContentInternal fromString(String name) { return fromString(name, RecordingContentInternal.class); } - /** - * Gets known RecordingContentInternal values. - * - * @return known RecordingContentInternal values. - */ + /** @return known RecordingContentInternal values. */ public static Collection values() { return values(RecordingContentInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java index b0e74cd26d180..9bb0859bafbea 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java @@ -8,37 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The format type of call recording. - */ +/** Defines values for RecordingFormatInternal. */ public final class RecordingFormatInternal extends ExpandableStringEnum { - /** - * Static value wav for RecordingFormatInternal. - */ + /** Static value wav for RecordingFormatInternal. */ public static final RecordingFormatInternal WAV = fromString("wav"); - /** - * Static value mp3 for RecordingFormatInternal. - */ + /** Static value mp3 for RecordingFormatInternal. */ public static final RecordingFormatInternal MP3 = fromString("mp3"); - /** - * Static value mp4 for RecordingFormatInternal. - */ + /** Static value mp4 for RecordingFormatInternal. */ public static final RecordingFormatInternal MP4 = fromString("mp4"); - /** - * Creates a new instance of RecordingFormatInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingFormatInternal() { - } - /** * Creates or finds a RecordingFormatInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingFormatInternal. */ @@ -47,11 +30,7 @@ public static RecordingFormatInternal fromString(String name) { return fromString(name, RecordingFormatInternal.class); } - /** - * Gets known RecordingFormatInternal values. - * - * @return known RecordingFormatInternal values. - */ + /** @return known RecordingFormatInternal values. */ public static Collection values() { return values(RecordingFormatInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java index edb72ca7c9526..0e87ac073cf63 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines values for RecordingStateInternal. - */ +/** Defines values for RecordingStateInternal. */ public final class RecordingStateInternal extends ExpandableStringEnum { - /** - * Static value active for RecordingStateInternal. - */ + /** Static value active for RecordingStateInternal. */ public static final RecordingStateInternal ACTIVE = fromString("active"); - /** - * Static value inactive for RecordingStateInternal. - */ + /** Static value inactive for RecordingStateInternal. */ public static final RecordingStateInternal INACTIVE = fromString("inactive"); - /** - * Creates a new instance of RecordingStateInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingStateInternal() { - } - /** * Creates or finds a RecordingStateInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingStateInternal. */ @@ -42,11 +27,7 @@ public static RecordingStateInternal fromString(String name) { return fromString(name, RecordingStateInternal.class); } - /** - * Gets known RecordingStateInternal values. - * - * @return known RecordingStateInternal values. - */ + /** @return known RecordingStateInternal values. */ public static Collection values() { return values(RecordingStateInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java index ea2b47ffd0f39..5aa4c7cc30a58 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The RecordingStateResponseInternal model. - */ +/** The RecordingStateResponseInternal model. */ @Fluent public final class RecordingStateResponseInternal { /* @@ -30,15 +28,9 @@ public final class RecordingStateResponseInternal { @JsonProperty(value = "recordingType") private RecordingType recordingType; - /** - * Creates an instance of RecordingStateResponseInternal class. - */ - public RecordingStateResponseInternal() { - } - /** * Get the recordingId property: The recordingId property. - * + * * @return the recordingId value. */ public String getRecordingId() { @@ -47,7 +39,7 @@ public String getRecordingId() { /** * Set the recordingId property: The recordingId property. - * + * * @param recordingId the recordingId value to set. * @return the RecordingStateResponseInternal object itself. */ @@ -58,7 +50,7 @@ public RecordingStateResponseInternal setRecordingId(String recordingId) { /** * Get the recordingState property: The recordingState property. - * + * * @return the recordingState value. */ public RecordingStateInternal getRecordingState() { @@ -67,7 +59,7 @@ public RecordingStateInternal getRecordingState() { /** * Set the recordingState property: The recordingState property. - * + * * @param recordingState the recordingState value to set. * @return the RecordingStateResponseInternal object itself. */ @@ -78,7 +70,7 @@ public RecordingStateResponseInternal setRecordingState(RecordingStateInternal r /** * Get the recordingType property: The recordingType property. - * + * * @return the recordingType value. */ public RecordingType getRecordingType() { @@ -87,7 +79,7 @@ public RecordingType getRecordingType() { /** * Set the recordingType property: The recordingType property. - * + * * @param recordingType the recordingType value to set. * @return the RecordingStateResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java index 78fb625d43e07..2683f83ac474a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines the type of external storage. - */ +/** Defines values for RecordingStorageTypeInternal. */ public final class RecordingStorageTypeInternal extends ExpandableStringEnum { - /** - * Static value acs for RecordingStorageTypeInternal. - */ + /** Static value acs for RecordingStorageTypeInternal. */ public static final RecordingStorageTypeInternal ACS = fromString("acs"); - /** - * Static value blobStorage for RecordingStorageTypeInternal. - */ + /** Static value blobStorage for RecordingStorageTypeInternal. */ public static final RecordingStorageTypeInternal BLOB_STORAGE = fromString("blobStorage"); - /** - * Creates a new instance of RecordingStorageTypeInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingStorageTypeInternal() { - } - /** * Creates or finds a RecordingStorageTypeInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingStorageTypeInternal. */ @@ -42,11 +27,7 @@ public static RecordingStorageTypeInternal fromString(String name) { return fromString(name, RecordingStorageTypeInternal.class); } - /** - * Gets known RecordingStorageTypeInternal values. - * - * @return known RecordingStorageTypeInternal values. - */ + /** @return known RecordingStorageTypeInternal values. */ public static Collection values() { return values(RecordingStorageTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java index 9152b81020040..b57759603d3b9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines values for RecordingType. - */ +/** Defines values for RecordingType. */ public final class RecordingType extends ExpandableStringEnum { - /** - * Static value acs for RecordingType. - */ + /** Static value acs for RecordingType. */ public static final RecordingType ACS = fromString("acs"); - /** - * Static value teams for RecordingType. - */ + /** Static value teams for RecordingType. */ public static final RecordingType TEAMS = fromString("teams"); - /** - * Creates a new instance of RecordingType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecordingType() { - } - /** * Creates or finds a RecordingType from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecordingType. */ @@ -42,11 +27,7 @@ public static RecordingType fromString(String name) { return fromString(name, RecordingType.class); } - /** - * Gets known RecordingType values. - * - * @return known RecordingType values. - */ + /** @return known RecordingType values. */ public static Collection values() { return values(RecordingType.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java index 6c893b5826c17..3b125f6604178 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The request payload for redirecting the call. - */ +/** The request payload for redirecting the call. */ @Fluent public final class RedirectCallRequestInternal { /* @@ -30,15 +28,9 @@ public final class RedirectCallRequestInternal { @JsonProperty(value = "customCallingContext") private CustomCallingContext customCallingContext; - /** - * Creates an instance of RedirectCallRequestInternal class. - */ - public RedirectCallRequestInternal() { - } - /** * Get the incomingCallContext property: The context associated with the call. - * + * * @return the incomingCallContext value. */ public String getIncomingCallContext() { @@ -47,7 +39,7 @@ public String getIncomingCallContext() { /** * Set the incomingCallContext property: The context associated with the call. - * + * * @param incomingCallContext the incomingCallContext value to set. * @return the RedirectCallRequestInternal object itself. */ @@ -58,7 +50,7 @@ public RedirectCallRequestInternal setIncomingCallContext(String incomingCallCon /** * Get the target property: The target identity to redirect the call to. - * + * * @return the target value. */ public CommunicationIdentifierModel getTarget() { @@ -67,7 +59,7 @@ public CommunicationIdentifierModel getTarget() { /** * Set the target property: The target identity to redirect the call to. - * + * * @param target the target value to set. * @return the RedirectCallRequestInternal object itself. */ @@ -78,7 +70,7 @@ public RedirectCallRequestInternal setTarget(CommunicationIdentifierModel target /** * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @return the customCallingContext value. */ public CustomCallingContext getCustomCallingContext() { @@ -87,7 +79,7 @@ public CustomCallingContext getCustomCallingContext() { /** * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @param customCallingContext the customCallingContext value to set. * @return the RedirectCallRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java index 9b4a2b4c1aa68..b315242b2382e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The request payload for rejecting the call. - */ +/** The request payload for rejecting the call. */ @Fluent public final class RejectCallRequestInternal { /* @@ -24,15 +22,9 @@ public final class RejectCallRequestInternal { @JsonProperty(value = "callRejectReason") private CallRejectReasonInternal callRejectReason; - /** - * Creates an instance of RejectCallRequestInternal class. - */ - public RejectCallRequestInternal() { - } - /** * Get the incomingCallContext property: The context associated with the call. - * + * * @return the incomingCallContext value. */ public String getIncomingCallContext() { @@ -41,7 +33,7 @@ public String getIncomingCallContext() { /** * Set the incomingCallContext property: The context associated with the call. - * + * * @param incomingCallContext the incomingCallContext value to set. * @return the RejectCallRequestInternal object itself. */ @@ -52,7 +44,7 @@ public RejectCallRequestInternal setIncomingCallContext(String incomingCallConte /** * Get the callRejectReason property: The rejection reason. - * + * * @return the callRejectReason value. */ public CallRejectReasonInternal getCallRejectReason() { @@ -61,7 +53,7 @@ public CallRejectReasonInternal getCallRejectReason() { /** * Set the callRejectReason property: The rejection reason. - * + * * @param callRejectReason the callRejectReason value to set. * @return the RejectCallRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java index 70553ffe3a923..c49d55435519c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java @@ -7,13 +7,12 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The failed to remove participant event. - */ +/** The failed to remove participant event. */ @Immutable public final class RemoveParticipantFailed { /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) private String operationContext; @@ -43,21 +42,16 @@ public final class RemoveParticipantFailed { private String serverCallId; /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + * Correlation ID for event to call correlation. Also called ChainId for + * skype chain ID. */ @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) private String correlationId; - /** - * Creates an instance of RemoveParticipantFailed class. - */ - public RemoveParticipantFailed() { - } - /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -66,7 +60,7 @@ public String getOperationContext() { /** * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * + * * @return the resultInformation value. */ public ResultInformation getResultInformation() { @@ -75,7 +69,7 @@ public ResultInformation getResultInformation() { /** * Get the participant property: Participant. - * + * * @return the participant value. */ public CommunicationIdentifierModel getParticipant() { @@ -84,7 +78,7 @@ public CommunicationIdentifierModel getParticipant() { /** * Get the callConnectionId property: Call connection ID. - * + * * @return the callConnectionId value. */ public String getCallConnectionId() { @@ -93,7 +87,7 @@ public String getCallConnectionId() { /** * Get the serverCallId property: Server call ID. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -101,9 +95,9 @@ public String getServerCallId() { } /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype - * chain ID. - * + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * * @return the correlationId value. */ public String getCorrelationId() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java index 763c9de5704a2..de78413ebbdb2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The remove participant by identifier request. - */ +/** The remove participant by identifier request. */ @Fluent public final class RemoveParticipantRequestInternal { /* @@ -19,28 +17,24 @@ public final class RemoveParticipantRequestInternal { private CommunicationIdentifierModel participantToRemove; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of RemoveParticipantRequestInternal class. - */ - public RemoveParticipantRequestInternal() { - } - /** * Get the participantToRemove property: The participants to be removed from the call. - * + * * @return the participantToRemove value. */ public CommunicationIdentifierModel getParticipantToRemove() { @@ -49,7 +43,7 @@ public CommunicationIdentifierModel getParticipantToRemove() { /** * Set the participantToRemove property: The participants to be removed from the call. - * + * * @param participantToRemove the participantToRemove value to set. * @return the RemoveParticipantRequestInternal object itself. */ @@ -61,7 +55,7 @@ public RemoveParticipantRequestInternal setParticipantToRemove(CommunicationIden /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -71,7 +65,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the RemoveParticipantRequestInternal object itself. */ @@ -82,10 +76,9 @@ public RemoveParticipantRequestInternal setOperationContext(String operationCont /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -94,10 +87,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the RemoveParticipantRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java index f948b50eb5deb..ac1747ed3cba5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The response payload for removing participants of the call. - */ +/** The response payload for removing participants of the call. */ @Fluent public final class RemoveParticipantResponseInternal { /* @@ -18,15 +16,9 @@ public final class RemoveParticipantResponseInternal { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of RemoveParticipantResponseInternal class. - */ - public RemoveParticipantResponseInternal() { - } - /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -35,7 +27,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the RemoveParticipantResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java index 06916d92177d2..2a1ea8af4fb4f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java @@ -7,13 +7,12 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The participant removed event. - */ +/** The participant removed event. */ @Immutable public final class RemoveParticipantSucceeded { /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) private String operationContext; @@ -43,21 +42,16 @@ public final class RemoveParticipantSucceeded { private String serverCallId; /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + * Correlation ID for event to call correlation. Also called ChainId for + * skype chain ID. */ @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) private String correlationId; - /** - * Creates an instance of RemoveParticipantSucceeded class. - */ - public RemoveParticipantSucceeded() { - } - /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -66,7 +60,7 @@ public String getOperationContext() { /** * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * + * * @return the resultInformation value. */ public ResultInformation getResultInformation() { @@ -75,7 +69,7 @@ public ResultInformation getResultInformation() { /** * Get the participant property: Participant. - * + * * @return the participant value. */ public CommunicationIdentifierModel getParticipant() { @@ -84,7 +78,7 @@ public CommunicationIdentifierModel getParticipant() { /** * Get the callConnectionId property: Call connection ID. - * + * * @return the callConnectionId value. */ public String getCallConnectionId() { @@ -93,7 +87,7 @@ public String getCallConnectionId() { /** * Get the serverCallId property: Server call ID. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -101,9 +95,9 @@ public String getServerCallId() { } /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype - * chain ID. - * + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * * @return the correlationId value. */ public String getCorrelationId() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java index 5a7c99c08920b..3063d5149440e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java @@ -7,21 +7,19 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The ResultInformation model. - */ +/** The ResultInformation model. */ @Fluent public final class ResultInformation { /* - * Code of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result - * was unexpected. + * Code of the current result. This can be helpful to Call Automation team + * to troubleshoot the issue if this result was unexpected. */ @JsonProperty(value = "code") private Integer code; /* - * Subcode of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this - * result was unexpected. + * Subcode of the current result. This can be helpful to Call Automation + * team to troubleshoot the issue if this result was unexpected. */ @JsonProperty(value = "subCode") private Integer subCode; @@ -32,16 +30,10 @@ public final class ResultInformation { @JsonProperty(value = "message") private String message; - /** - * Creates an instance of ResultInformation class. - */ - public ResultInformation() { - } - /** * Get the code property: Code of the current result. This can be helpful to Call Automation team to troubleshoot * the issue if this result was unexpected. - * + * * @return the code value. */ public Integer getCode() { @@ -51,7 +43,7 @@ public Integer getCode() { /** * Set the code property: Code of the current result. This can be helpful to Call Automation team to troubleshoot * the issue if this result was unexpected. - * + * * @param code the code value to set. * @return the ResultInformation object itself. */ @@ -63,7 +55,7 @@ public ResultInformation setCode(Integer code) { /** * Get the subCode property: Subcode of the current result. This can be helpful to Call Automation team to * troubleshoot the issue if this result was unexpected. - * + * * @return the subCode value. */ public Integer getSubCode() { @@ -73,7 +65,7 @@ public Integer getSubCode() { /** * Set the subCode property: Subcode of the current result. This can be helpful to Call Automation team to * troubleshoot the issue if this result was unexpected. - * + * * @param subCode the subCode value to set. * @return the ResultInformation object itself. */ @@ -84,7 +76,7 @@ public ResultInformation setSubCode(Integer subCode) { /** * Get the message property: Detail message that describes the current result. - * + * * @return the message value. */ public String getMessage() { @@ -93,7 +85,7 @@ public String getMessage() { /** * Set the message property: Detail message that describes the current result. - * + * * @param message the message value to set. * @return the ResultInformation object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java index 904d1be3eddd6..d832241bc417a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The SendDtmfTonesRequestInternal model. - */ +/** The SendDtmfTonesRequestInternal model. */ @Fluent public final class SendDtmfTonesRequestInternal { /* @@ -32,22 +30,17 @@ public final class SendDtmfTonesRequestInternal { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of SendDtmfTonesRequestInternal class. - */ - public SendDtmfTonesRequestInternal() { - } - /** * Get the tones property: List of tones to be sent to target participant. - * + * * @return the tones value. */ public List getTones() { @@ -56,7 +49,7 @@ public List getTones() { /** * Set the tones property: List of tones to be sent to target participant. - * + * * @param tones the tones value to set. * @return the SendDtmfTonesRequestInternal object itself. */ @@ -67,7 +60,7 @@ public SendDtmfTonesRequestInternal setTones(List tones) { /** * Get the targetParticipant property: Target participant of send Dtmf tones. - * + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -76,7 +69,7 @@ public CommunicationIdentifierModel getTargetParticipant() { /** * Set the targetParticipant property: Target participant of send Dtmf tones. - * + * * @param targetParticipant the targetParticipant value to set. * @return the SendDtmfTonesRequestInternal object itself. */ @@ -87,7 +80,7 @@ public SendDtmfTonesRequestInternal setTargetParticipant(CommunicationIdentifier /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -96,7 +89,7 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. * @return the SendDtmfTonesRequestInternal object itself. */ @@ -107,10 +100,9 @@ public SendDtmfTonesRequestInternal setOperationContext(String operationContext) /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -119,10 +111,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the SendDtmfTonesRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java index 9ee7c461d2eba..77b4ac25567a1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The SendDtmfTonesResultInternal model. - */ +/** The SendDtmfTonesResultInternal model. */ @Fluent public final class SendDtmfTonesResultInternal { /* @@ -18,15 +16,9 @@ public final class SendDtmfTonesResultInternal { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of SendDtmfTonesResultInternal class. - */ - public SendDtmfTonesResultInternal() { - } - /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -35,7 +27,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the SendDtmfTonesResultInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java index e47d7a5a84ebb..1a1a9f084f090 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java @@ -7,27 +7,20 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Options for continuous speech recognition. - */ +/** Options for continuous speech recognition. */ @Fluent public final class SpeechOptionsInternal { /* - * The length of end silence when user stops speaking and cogservice send response. + * The length of end silence when user stops speaking and cogservice send + * response. */ @JsonProperty(value = "endSilenceTimeoutInMs") private Long endSilenceTimeoutInMs; - /** - * Creates an instance of SpeechOptionsInternal class. - */ - public SpeechOptionsInternal() { - } - /** * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send * response. - * + * * @return the endSilenceTimeoutInMs value. */ public Long getEndSilenceTimeoutInMs() { @@ -37,7 +30,7 @@ public Long getEndSilenceTimeoutInMs() { /** * Set the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send * response. - * + * * @param endSilenceTimeoutInMs the endSilenceTimeoutInMs value to set. * @return the SpeechOptionsInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java index a881c4a05b347..b6fe3782b8044 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The speech recognition status as a result. - */ +/** The speech recognition status as a result. */ @Fluent public final class SpeechResultInternal { /* @@ -18,15 +16,9 @@ public final class SpeechResultInternal { @JsonProperty(value = "speech") private String speech; - /** - * Creates an instance of SpeechResultInternal class. - */ - public SpeechResultInternal() { - } - /** * Get the speech property: The recognized speech in string. - * + * * @return the speech value. */ public String getSpeech() { @@ -35,7 +27,7 @@ public String getSpeech() { /** * Set the speech property: The recognized speech in string. - * + * * @param speech the speech value to set. * @return the SpeechResultInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java index 4d2f90ce2b83e..80f99a142b29a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The SsmlSourceInternal model. - */ +/** The SsmlSourceInternal model. */ @Fluent public final class SsmlSourceInternal { /* @@ -24,15 +22,9 @@ public final class SsmlSourceInternal { @JsonProperty(value = "customVoiceEndpointId") private String customVoiceEndpointId; - /** - * Creates an instance of SsmlSourceInternal class. - */ - public SsmlSourceInternal() { - } - /** * Get the ssmlText property: Ssml string for the cognitive service to be played. - * + * * @return the ssmlText value. */ public String getSsmlText() { @@ -41,7 +33,7 @@ public String getSsmlText() { /** * Set the ssmlText property: Ssml string for the cognitive service to be played. - * + * * @param ssmlText the ssmlText value to set. * @return the SsmlSourceInternal object itself. */ @@ -52,7 +44,7 @@ public SsmlSourceInternal setSsmlText(String ssmlText) { /** * Get the customVoiceEndpointId property: Endpoint where the custom voice was deployed. - * + * * @return the customVoiceEndpointId value. */ public String getCustomVoiceEndpointId() { @@ -61,7 +53,7 @@ public String getCustomVoiceEndpointId() { /** * Set the customVoiceEndpointId property: Endpoint where the custom voice was deployed. - * + * * @param customVoiceEndpointId the customVoiceEndpointId value to set. * @return the SsmlSourceInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java index 39e5545db2ea6..cefffe2baa743 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The request payload start for call recording operation with call locator. - */ +/** The request payload start for call recording operation with call locator. */ @Fluent public final class StartCallRecordingRequestInternal { /* @@ -44,19 +42,24 @@ public final class StartCallRecordingRequestInternal { private RecordingFormatInternal recordingFormatType; /* - * The sequential order in which audio channels are assigned to participants in the unmixed recording. - * When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified, - * the audio channel to participant mapping will be automatically assigned based on the order in which participant - * first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. + * The sequential order in which audio channels are assigned to + * participants in the unmixed recording. + * When 'recordingChannelType' is set to 'unmixed' and + * `audioChannelParticipantOrdering is not specified, + * the audio channel to participant mapping will be automatically assigned + * based on the order in which participant + * first audio was detected. Channel to participant mapping details can be + * found in the metadata of the recording. */ @JsonProperty(value = "audioChannelParticipantOrdering") private List audioChannelParticipantOrdering; /* * The channel affinity of call recording - * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be - * automatically assigned. - * Channel-Participant mapping details can be found in the metadata of the recording. + * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is + * not specified, 'channel' will be automatically assigned. + * Channel-Participant mapping details can be found in the metadata of the + * recording. * /// */ @JsonProperty(value = "channelAffinity") @@ -69,20 +72,15 @@ public final class StartCallRecordingRequestInternal { private ExternalStorageInternal externalStorage; /* - * When set to true will start recording in Pause mode, which could be resumed. + * When set to true will start recording in Pause mode, which could be + * resumed. */ @JsonProperty(value = "pauseOnStart") private Boolean pauseOnStart; - /** - * Creates an instance of StartCallRecordingRequestInternal class. - */ - public StartCallRecordingRequestInternal() { - } - /** * Get the callLocator property: The call locator. - * + * * @return the callLocator value. */ public CallLocatorInternal getCallLocator() { @@ -91,7 +89,7 @@ public CallLocatorInternal getCallLocator() { /** * Set the callLocator property: The call locator. - * + * * @param callLocator the callLocator value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -102,7 +100,7 @@ public StartCallRecordingRequestInternal setCallLocator(CallLocatorInternal call /** * Get the recordingStateCallbackUri property: The uri to send notifications to. - * + * * @return the recordingStateCallbackUri value. */ public String getRecordingStateCallbackUri() { @@ -111,7 +109,7 @@ public String getRecordingStateCallbackUri() { /** * Set the recordingStateCallbackUri property: The uri to send notifications to. - * + * * @param recordingStateCallbackUri the recordingStateCallbackUri value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -122,7 +120,7 @@ public StartCallRecordingRequestInternal setRecordingStateCallbackUri(String rec /** * Get the recordingContentType property: The content type of call recording. - * + * * @return the recordingContentType value. */ public RecordingContentInternal getRecordingContentType() { @@ -131,7 +129,7 @@ public RecordingContentInternal getRecordingContentType() { /** * Set the recordingContentType property: The content type of call recording. - * + * * @param recordingContentType the recordingContentType value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -142,7 +140,7 @@ public StartCallRecordingRequestInternal setRecordingContentType(RecordingConten /** * Get the recordingChannelType property: The channel type of call recording. - * + * * @return the recordingChannelType value. */ public RecordingChannelInternal getRecordingChannelType() { @@ -151,7 +149,7 @@ public RecordingChannelInternal getRecordingChannelType() { /** * Set the recordingChannelType property: The channel type of call recording. - * + * * @param recordingChannelType the recordingChannelType value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -162,7 +160,7 @@ public StartCallRecordingRequestInternal setRecordingChannelType(RecordingChanne /** * Get the recordingFormatType property: The format type of call recording. - * + * * @return the recordingFormatType value. */ public RecordingFormatInternal getRecordingFormatType() { @@ -171,7 +169,7 @@ public RecordingFormatInternal getRecordingFormatType() { /** * Set the recordingFormatType property: The format type of call recording. - * + * * @param recordingFormatType the recordingFormatType value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -182,11 +180,11 @@ public StartCallRecordingRequestInternal setRecordingFormatType(RecordingFormatI /** * Get the audioChannelParticipantOrdering property: The sequential order in which audio channels are assigned to - * participants in the unmixed recording. - * When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified, - * the audio channel to participant mapping will be automatically assigned based on the order in which participant - * first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. - * + * participants in the unmixed recording. When 'recordingChannelType' is set to 'unmixed' and + * `audioChannelParticipantOrdering is not specified, the audio channel to participant mapping will be automatically + * assigned based on the order in which participant first audio was detected. Channel to participant mapping details + * can be found in the metadata of the recording. + * * @return the audioChannelParticipantOrdering value. */ public List getAudioChannelParticipantOrdering() { @@ -195,27 +193,25 @@ public List getAudioChannelParticipantOrdering() { /** * Set the audioChannelParticipantOrdering property: The sequential order in which audio channels are assigned to - * participants in the unmixed recording. - * When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified, - * the audio channel to participant mapping will be automatically assigned based on the order in which participant - * first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. - * + * participants in the unmixed recording. When 'recordingChannelType' is set to 'unmixed' and + * `audioChannelParticipantOrdering is not specified, the audio channel to participant mapping will be automatically + * assigned based on the order in which participant first audio was detected. Channel to participant mapping details + * can be found in the metadata of the recording. + * * @param audioChannelParticipantOrdering the audioChannelParticipantOrdering value to set. * @return the StartCallRecordingRequestInternal object itself. */ - public StartCallRecordingRequestInternal - setAudioChannelParticipantOrdering(List audioChannelParticipantOrdering) { + public StartCallRecordingRequestInternal setAudioChannelParticipantOrdering( + List audioChannelParticipantOrdering) { this.audioChannelParticipantOrdering = audioChannelParticipantOrdering; return this; } /** - * Get the channelAffinity property: The channel affinity of call recording - * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be - * automatically assigned. - * Channel-Participant mapping details can be found in the metadata of the recording. - * ///. - * + * Get the channelAffinity property: The channel affinity of call recording When 'recordingChannelType' is set to + * 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned. Channel-Participant + * mapping details can be found in the metadata of the recording. ///. + * * @return the channelAffinity value. */ public List getChannelAffinity() { @@ -223,12 +219,10 @@ public List getChannelAffinity() { } /** - * Set the channelAffinity property: The channel affinity of call recording - * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be - * automatically assigned. - * Channel-Participant mapping details can be found in the metadata of the recording. - * ///. - * + * Set the channelAffinity property: The channel affinity of call recording When 'recordingChannelType' is set to + * 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned. Channel-Participant + * mapping details can be found in the metadata of the recording. ///. + * * @param channelAffinity the channelAffinity value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -239,7 +233,7 @@ public StartCallRecordingRequestInternal setChannelAffinity(List { - /** - * Static value transcriptionStarted for TranscriptionStatus. - */ + /** Static value transcriptionStarted for TranscriptionStatus. */ public static final TranscriptionStatus TRANSCRIPTION_STARTED = fromString("transcriptionStarted"); - /** - * Static value transcriptionFailed for TranscriptionStatus. - */ + /** Static value transcriptionFailed for TranscriptionStatus. */ public static final TranscriptionStatus TRANSCRIPTION_FAILED = fromString("transcriptionFailed"); - /** - * Static value transcriptionResumed for TranscriptionStatus. - */ + /** Static value transcriptionResumed for TranscriptionStatus. */ public static final TranscriptionStatus TRANSCRIPTION_RESUMED = fromString("transcriptionResumed"); - /** - * Static value transcriptionUpdated for TranscriptionStatus. - */ + /** Static value transcriptionUpdated for TranscriptionStatus. */ public static final TranscriptionStatus TRANSCRIPTION_UPDATED = fromString("transcriptionUpdated"); - /** - * Static value transcriptionStopped for TranscriptionStatus. - */ + /** Static value transcriptionStopped for TranscriptionStatus. */ public static final TranscriptionStatus TRANSCRIPTION_STOPPED = fromString("transcriptionStopped"); - /** - * Static value unspecifiedError for TranscriptionStatus. - */ + /** Static value unspecifiedError for TranscriptionStatus. */ public static final TranscriptionStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); - /** - * Creates a new instance of TranscriptionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptionStatus() { - } - /** * Creates or finds a TranscriptionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding TranscriptionStatus. */ @@ -62,11 +39,7 @@ public static TranscriptionStatus fromString(String name) { return fromString(name, TranscriptionStatus.class); } - /** - * Gets known TranscriptionStatus values. - * - * @return known TranscriptionStatus values. - */ + /** @return known TranscriptionStatus values. */ public static Collection values() { return values(TranscriptionStatus.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java index ee3bb1f80e3b3..0b7fbc20a1d5f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java @@ -8,102 +8,61 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Defines values for TranscriptionStatusDetails. - */ +/** Defines values for TranscriptionStatusDetails. */ public final class TranscriptionStatusDetails extends ExpandableStringEnum { - /** - * Static value subscriptionStarted for TranscriptionStatusDetails. - */ + /** Static value subscriptionStarted for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); - /** - * Static value streamConnectionReestablished for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_REESTABLISHED - = fromString("streamConnectionReestablished"); + /** Static value streamConnectionReestablished for TranscriptionStatusDetails. */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_REESTABLISHED = + fromString("streamConnectionReestablished"); - /** - * Static value streamConnectionUnsuccessful for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_UNSUCCESSFUL - = fromString("streamConnectionUnsuccessful"); + /** Static value streamConnectionUnsuccessful for TranscriptionStatusDetails. */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_UNSUCCESSFUL = + fromString("streamConnectionUnsuccessful"); - /** - * Static value streamUrlMissing for TranscriptionStatusDetails. - */ + /** Static value streamUrlMissing for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); - /** - * Static value serviceShutdown for TranscriptionStatusDetails. - */ + /** Static value serviceShutdown for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); - /** - * Static value streamConnectionInterrupted for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_INTERRUPTED - = fromString("streamConnectionInterrupted"); + /** Static value streamConnectionInterrupted for TranscriptionStatusDetails. */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_INTERRUPTED = + fromString("streamConnectionInterrupted"); - /** - * Static value speechServicesConnectionError for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails SPEECH_SERVICES_CONNECTION_ERROR - = fromString("speechServicesConnectionError"); + /** Static value speechServicesConnectionError for TranscriptionStatusDetails. */ + public static final TranscriptionStatusDetails SPEECH_SERVICES_CONNECTION_ERROR = + fromString("speechServicesConnectionError"); - /** - * Static value subscriptionStopped for TranscriptionStatusDetails. - */ + /** Static value subscriptionStopped for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); - /** - * Static value unspecifiedError for TranscriptionStatusDetails. - */ + /** Static value unspecifiedError for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); - /** - * Static value authenticationFailure for TranscriptionStatusDetails. - */ + /** Static value authenticationFailure for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure"); - /** - * Static value badRequest for TranscriptionStatusDetails. - */ + /** Static value badRequest for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails BAD_REQUEST = fromString("badRequest"); - /** - * Static value tooManyRequests for TranscriptionStatusDetails. - */ + /** Static value tooManyRequests for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests"); - /** - * Static value forbidden for TranscriptionStatusDetails. - */ + /** Static value forbidden for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails FORBIDDEN = fromString("forbidden"); - /** - * Static value serviceTimeout for TranscriptionStatusDetails. - */ + /** Static value serviceTimeout for TranscriptionStatusDetails. */ public static final TranscriptionStatusDetails SERVICE_TIMEOUT = fromString("serviceTimeout"); - /** - * Static value transcriptionLocaleUpdated for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails TRANSCRIPTION_LOCALE_UPDATED - = fromString("transcriptionLocaleUpdated"); - - /** - * Creates a new instance of TranscriptionStatusDetails value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptionStatusDetails() { - } + /** Static value transcriptionLocaleUpdated for TranscriptionStatusDetails. */ + public static final TranscriptionStatusDetails TRANSCRIPTION_LOCALE_UPDATED = + fromString("transcriptionLocaleUpdated"); /** * Creates or finds a TranscriptionStatusDetails from its string representation. - * + * * @param name a name to look for. * @return the corresponding TranscriptionStatusDetails. */ @@ -112,11 +71,7 @@ public static TranscriptionStatusDetails fromString(String name) { return fromString(name, TranscriptionStatusDetails.class); } - /** - * Gets known TranscriptionStatusDetails values. - * - * @return known TranscriptionStatusDetails values. - */ + /** @return known TranscriptionStatusDetails values. */ public static Collection values() { return values(TranscriptionStatusDetails.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java new file mode 100644 index 0000000000000..187ec369569f8 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TranscriptionTransportTypeInternal. */ +public final class TranscriptionTransportTypeInternal extends ExpandableStringEnum { + /** Static value websocket for TranscriptionTransportTypeInternal. */ + public static final TranscriptionTransportTypeInternal WEBSOCKET = fromString("websocket"); + + /** + * Creates or finds a TranscriptionTransportTypeInternal from its string representation. + * + * @param name a name to look for. + * @return the corresponding TranscriptionTransportTypeInternal. + */ + @JsonCreator + public static TranscriptionTransportTypeInternal fromString(String name) { + return fromString(name, TranscriptionTransportTypeInternal.class); + } + + /** @return known TranscriptionTransportTypeInternal values. */ + public static Collection values() { + return values(TranscriptionTransportTypeInternal.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java index 306d9a2b5344c..4996247fbfb75 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The TranscriptionUpdate model. - */ +/** The TranscriptionUpdate model. */ @Fluent public final class TranscriptionUpdate { /* @@ -24,15 +22,9 @@ public final class TranscriptionUpdate { @JsonProperty(value = "transcriptionStatusDetails") private TranscriptionStatusDetails transcriptionStatusDetails; - /** - * Creates an instance of TranscriptionUpdate class. - */ - public TranscriptionUpdate() { - } - /** * Get the transcriptionStatus property: The transcriptionStatus property. - * + * * @return the transcriptionStatus value. */ public TranscriptionStatus getTranscriptionStatus() { @@ -41,7 +33,7 @@ public TranscriptionStatus getTranscriptionStatus() { /** * Set the transcriptionStatus property: The transcriptionStatus property. - * + * * @param transcriptionStatus the transcriptionStatus value to set. * @return the TranscriptionUpdate object itself. */ @@ -52,7 +44,7 @@ public TranscriptionUpdate setTranscriptionStatus(TranscriptionStatus transcript /** * Get the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * + * * @return the transcriptionStatusDetails value. */ public TranscriptionStatusDetails getTranscriptionStatusDetails() { @@ -61,7 +53,7 @@ public TranscriptionStatusDetails getTranscriptionStatusDetails() { /** * Set the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * + * * @param transcriptionStatusDetails the transcriptionStatusDetails value to set. * @return the TranscriptionUpdate object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdated.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdated.java deleted file mode 100644 index 745ccccf55bde..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdated.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionUpdated model. - */ -@Immutable -public final class TranscriptionUpdated { - /* - * Used by customers when calling mid-call actions to correlate the request to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private TranscriptionUpdate transcriptionUpdate; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Creates an instance of TranscriptionUpdated class. - */ - public TranscriptionUpdated() { - } - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdate property: Defines the result for TranscriptionUpdate with the current status and the - * details about the status. - * - * @return the transcriptionUpdate value. - */ - public TranscriptionUpdate getTranscriptionUpdate() { - return this.transcriptionUpdate; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype - * chain ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java index 14ae4d5126106..a62c8d7ba903e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The response payload for transferring the call. - */ +/** The response payload for transferring the call. */ @Fluent public final class TransferCallResponseInternal { /* @@ -18,15 +16,9 @@ public final class TransferCallResponseInternal { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of TransferCallResponseInternal class. - */ - public TransferCallResponseInternal() { - } - /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -35,7 +27,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the TransferCallResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java index f10523a0d19f7..cfd9adeb87941 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The request payload for transferring call to a participant. - */ +/** The request payload for transferring call to a participant. */ @Fluent public final class TransferToParticipantRequestInternal { /* @@ -25,7 +23,8 @@ public final class TransferToParticipantRequestInternal { private CustomCallingContext customCallingContext; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; @@ -37,22 +36,17 @@ public final class TransferToParticipantRequestInternal { private CommunicationIdentifierModel transferee; /* - * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. + * Set a callback URI that overrides the default callback URI set by + * CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; - /** - * Creates an instance of TransferToParticipantRequestInternal class. - */ - public TransferToParticipantRequestInternal() { - } - /** * Get the targetParticipant property: The identity of the target where call should be transferred to. - * + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -61,7 +55,7 @@ public CommunicationIdentifierModel getTargetParticipant() { /** * Set the targetParticipant property: The identity of the target where call should be transferred to. - * + * * @param targetParticipant the targetParticipant value to set. * @return the TransferToParticipantRequestInternal object itself. */ @@ -72,7 +66,7 @@ public TransferToParticipantRequestInternal setTargetParticipant(CommunicationId /** * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @return the customCallingContext value. */ public CustomCallingContext getCustomCallingContext() { @@ -81,7 +75,7 @@ public CustomCallingContext getCustomCallingContext() { /** * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * + * * @param customCallingContext the customCallingContext value to set. * @return the TransferToParticipantRequestInternal object itself. */ @@ -93,7 +87,7 @@ public TransferToParticipantRequestInternal setCustomCallingContext(CustomCallin /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -103,7 +97,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the TransferToParticipantRequestInternal object itself. */ @@ -114,7 +108,7 @@ public TransferToParticipantRequestInternal setOperationContext(String operation /** * Get the transferee property: Transferee is the participant who is transferred away. - * + * * @return the transferee value. */ public CommunicationIdentifierModel getTransferee() { @@ -123,7 +117,7 @@ public CommunicationIdentifierModel getTransferee() { /** * Set the transferee property: Transferee is the participant who is transferred away. - * + * * @param transferee the transferee value to set. * @return the TransferToParticipantRequestInternal object itself. */ @@ -134,10 +128,9 @@ public TransferToParticipantRequestInternal setTransferee(CommunicationIdentifie /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @return the operationCallbackUri value. */ public String getOperationCallbackUri() { @@ -146,10 +139,9 @@ public String getOperationCallbackUri() { /** * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be - * used. - * + * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI + * set by CreateCall/AnswerCall will be used. + * * @param operationCallbackUri the operationCallbackUri value to set. * @return the TransferToParticipantRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java index 0730a0b450104..112653a62c30f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The request payload for unmuting participant from the call. - */ +/** The request payload for unmuting participant from the call. */ @Fluent public final class UnmuteParticipantsRequestInternal { /* @@ -21,21 +19,15 @@ public final class UnmuteParticipantsRequestInternal { private List targetParticipants; /* - * Used by customers when calling mid-call actions to correlate the request to the response event. + * Used by customers when calling mid-call actions to correlate the request + * to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /** - * Creates an instance of UnmuteParticipantsRequestInternal class. - */ - public UnmuteParticipantsRequestInternal() { - } - - /** - * Get the targetParticipants property: Participants to be unmuted from the call. - * Only ACS Users are supported. - * + * Get the targetParticipants property: Participants to be unmuted from the call. Only ACS Users are supported. + * * @return the targetParticipants value. */ public List getTargetParticipants() { @@ -43,14 +35,13 @@ public List getTargetParticipants() { } /** - * Set the targetParticipants property: Participants to be unmuted from the call. - * Only ACS Users are supported. - * + * Set the targetParticipants property: Participants to be unmuted from the call. Only ACS Users are supported. + * * @param targetParticipants the targetParticipants value to set. * @return the UnmuteParticipantsRequestInternal object itself. */ - public UnmuteParticipantsRequestInternal - setTargetParticipants(List targetParticipants) { + public UnmuteParticipantsRequestInternal setTargetParticipants( + List targetParticipants) { this.targetParticipants = targetParticipants; return this; } @@ -58,7 +49,7 @@ public List getTargetParticipants() { /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -68,7 +59,7 @@ public String getOperationContext() { /** * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. - * + * * @param operationContext the operationContext value to set. * @return the UnmuteParticipantsRequestInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java index b1ab8c3212427..6b26134362d09 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The response payload for unmuting participants from the call. - */ +/** The response payload for unmuting participants from the call. */ @Fluent public final class UnmuteParticipantsResponseInternal { /* @@ -18,15 +16,9 @@ public final class UnmuteParticipantsResponseInternal { @JsonProperty(value = "operationContext") private String operationContext; - /** - * Creates an instance of UnmuteParticipantsResponseInternal class. - */ - public UnmuteParticipantsResponseInternal() { - } - /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -35,7 +27,7 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. * @return the UnmuteParticipantsResponseInternal object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionDataRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java similarity index 70% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionDataRequest.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java index f94b420ce1835..bd7e4be227072 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionDataRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java @@ -7,18 +7,15 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The UpdateTranscriptionDataRequest model. */ +/** The UpdateTranscriptionRequestInternal model. */ @Fluent -public final class UpdateTranscriptionDataRequest { +public final class UpdateTranscriptionRequestInternal { /* * Defines new locale for transcription. */ @JsonProperty(value = "locale", required = true) private String locale; - /** Creates an instance of UpdateTranscriptionDataRequest class. */ - public UpdateTranscriptionDataRequest() {} - /** * Get the locale property: Defines new locale for transcription. * @@ -32,9 +29,9 @@ public String getLocale() { * Set the locale property: Defines new locale for transcription. * * @param locale the locale value to set. - * @return the UpdateTranscriptionDataRequest object itself. + * @return the UpdateTranscriptionRequestInternal object itself. */ - public UpdateTranscriptionDataRequest setLocale(String locale) { + public UpdateTranscriptionRequestInternal setLocale(String locale) { this.locale = locale; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java index 30996987b7d9c..7b3f2174ee6c2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The UserConsent model. - */ +/** The UserConsent model. */ @Fluent public final class UserConsent { /* @@ -18,15 +16,9 @@ public final class UserConsent { @JsonProperty(value = "recording") private Integer recording; - /** - * Creates an instance of UserConsent class. - */ - public UserConsent() { - } - /** * Get the recording property: The recording property. - * + * * @return the recording value. */ public Integer getRecording() { @@ -35,7 +27,7 @@ public Integer getRecording() { /** * Set the recording property: The recording property. - * + * * @param recording the recording value to set. * @return the UserConsent object itself. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java index 4beeeb8bb5f05..271c6d62f0fb1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java @@ -8,32 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * Voice kind type. - */ +/** Defines values for VoiceKindInternal. */ public final class VoiceKindInternal extends ExpandableStringEnum { - /** - * Static value male for VoiceKindInternal. - */ + /** Static value male for VoiceKindInternal. */ public static final VoiceKindInternal MALE = fromString("male"); - /** - * Static value female for VoiceKindInternal. - */ + /** Static value female for VoiceKindInternal. */ public static final VoiceKindInternal FEMALE = fromString("female"); - /** - * Creates a new instance of VoiceKindInternal value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public VoiceKindInternal() { - } - /** * Creates or finds a VoiceKindInternal from its string representation. - * + * * @param name a name to look for. * @return the corresponding VoiceKindInternal. */ @@ -42,11 +27,7 @@ public static VoiceKindInternal fromString(String name) { return fromString(name, VoiceKindInternal.class); } - /** - * Gets known VoiceKindInternal values. - * - * @return known VoiceKindInternal values. - */ + /** @return known VoiceKindInternal values. */ public static Collection values() { return values(VoiceKindInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/package-info.java index 035147d5ef277..c5acfc47edf69 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/package-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for AzureCommunicationCallAutomationService. - * Azure Communication Service Call Automation APIs. + * Package containing the data models for AzureCommunicationCallAutomationService. Azure Communication Service Call + * Automation APIs. */ package com.azure.communication.callautomation.implementation.models; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/package-info.java index 269588854091c..9bcf30c27c07e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/package-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for AzureCommunicationCallAutomationService. - * Azure Communication Service Call Automation APIs. + * Package containing the implementations for AzureCommunicationCallAutomationService. Azure Communication Service Call + * Automation APIs. */ package com.azure.communication.callautomation.implementation; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java index 2f56cf5a95c9c..e01ab2ed815b3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java @@ -25,6 +25,11 @@ public final class AnswerCallOptions { */ private MediaStreamingOptions mediaStreamingOptions; + /** + * Transcription Configuration. + */ + private TranscriptionOptions transcriptionOptions; + /* * AI options for the call. */ @@ -64,6 +69,15 @@ public String getCallbackUrl() { return callbackUrl; } + /** + * Get the Transcription configuration. + * + * @return the transcriptionConfiguration. + */ + public TranscriptionOptions getTranscriptionConfiguration() { + return transcriptionOptions; + } + /** * Get the operationContext. * @@ -73,6 +87,17 @@ public String getOperationContext() { return operationContext; } + /** + * Set the transcription configuration. + * + * @param transcriptionOptions The transcription configuration. + * @return the AnswerCallOptions object itself. + */ + public AnswerCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { + this.transcriptionOptions = transcriptionOptions; + return this; + } + /** * Set the operationContext. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java index 9dd9128c3fbd7..c635f1e5ed877 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java @@ -30,6 +30,7 @@ public final class CallConnectionProperties { private final CallConnectionState callConnectionState; private final String callbackUrl; private final String mediaSubscriptionId; + private final String dataSubscriptionId; private final CommunicationUserIdentifier answeredBy; private final String correlationId; @@ -57,6 +58,7 @@ public CallConnectionProperties() { this.callConnectionState = null; this.callbackUrl = null; this.mediaSubscriptionId = null; + this.dataSubscriptionId = null; this.answeredBy = null; this.correlationId = null; } @@ -76,6 +78,7 @@ public CallConnectionProperties() { this.callConnectionState = CallConnectionState.fromString(callConnectionPropertiesInternal.getCallConnectionState().toString()); this.callbackUrl = callConnectionPropertiesInternal.getCallbackUri(); this.mediaSubscriptionId = callConnectionPropertiesInternal.getMediaSubscriptionId(); + this.dataSubscriptionId = callConnectionPropertiesInternal.getDataSubscriptionId(); this.answeredBy = CommunicationUserIdentifierConverter.convert(callConnectionPropertiesInternal.getAnsweredBy()); this.correlationId = callConnectionPropertiesInternal.getCorrelationId(); } @@ -161,6 +164,15 @@ public String getMediaSubscriptionId() { return mediaSubscriptionId; } + /** + * Get the dataSubscriptionId property: SubscriptionId for transcription. + * + * @return the dataSubscriptionId value. + */ + public String getDataSubscriptionId() { + return dataSubscriptionId; + } + /** * Get identity that answered the call * @return identity that answered the call diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java index bf216115d125d..75f06ad801179 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java @@ -37,6 +37,12 @@ public final class CreateCallOptions { */ private MediaStreamingOptions mediaStreamingOptions; + + /** + * Transcription Configuration. + */ + private TranscriptionOptions transcriptionOptions; + /** * Custom Context */ @@ -62,6 +68,16 @@ public String getOperationContext() { return operationContext; } + /** + * Get the Transcription configuration. + * + * @return the transcriptionConfiguration. + */ + public TranscriptionOptions getTranscriptionConfiguration() { + return transcriptionOptions; + } + + /** * Set the operationContext: A customer set value used to track the answering of a call. * @@ -73,6 +89,17 @@ public CreateCallOptions setOperationContext(String operationContext) { return this; } + /** + * Set the transcription configuration. + * + * @param transcriptionOptions The transcription configuration. + * @return the CreateCallOptions object itself. + */ + public CreateCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { + this.transcriptionOptions = transcriptionOptions; + return this; + } + /** * Get Call invitee information * @return call invitee information diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java index f7239c054b42c..5ee265339f384 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java @@ -30,6 +30,16 @@ public final class CreateGroupCallOptions { */ private String operationContext; + /** + * Media Streaming Configuration. + */ + private MediaStreamingOptions mediaStreamingOptions; + + /** + * Transcription Configuration. + */ + private TranscriptionOptions transcriptionOptions; + /** * Display name for call source */ @@ -45,11 +55,6 @@ public final class CreateGroupCallOptions { */ private CallIntelligenceOptions callIntelligenceOptions; - /** - * Media Streaming Configuration. - */ - private MediaStreamingOptions mediaStreamingOptions; - /** * Custom Context */ @@ -123,6 +128,28 @@ public CreateGroupCallOptions setOperationContext(String operationContext) { return this; } + /** + * Set the media streaming configuration. + * + * @param mediaStreamingOptions The media streaming configuration. + * @return the CreateGroupCallOptions object itself. + */ + public CreateGroupCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { + this.mediaStreamingOptions = mediaStreamingOptions; + return this; + } + + /** + * Set the transcription configuration. + * + * @param transcriptionOptions The transcription configuration. + * @return the CreateGroupCallOptions object itself. + */ + public CreateGroupCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { + this.transcriptionOptions = transcriptionOptions; + return this; + } + /** * set display name for caller * @param sourceDisplayName display name for caller @@ -173,14 +200,12 @@ public MediaStreamingOptions getMediaStreamingConfiguration() { } /** - * Set the media streaming configuration. + * Get the Transcription configuration. * - * @param mediaStreamingOptions The media streaming configuration. - * @return the CreateCallOptions object itself. + * @return the transcriptionConfiguration. */ - public CreateGroupCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; - return this; + public TranscriptionOptions getTranscriptionConfiguration() { + return transcriptionOptions; } /** diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java index e38d4451ccef6..3499b3668b4d2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java @@ -16,7 +16,7 @@ public final class MediaStreamingOptions { private final String transportUrl; /* - * The type of tranport to be used for media streaming, eg. Websocket + * The type of transport to be used for media streaming, eg. Websocket */ @JsonProperty(value = "transportType") private final MediaStreamingTransport transportType; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageBase.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageBase.java deleted file mode 100644 index aeefd9225c917..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageBase.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -/** The abstract classed used as parent of MediaStreaming[package type]. */ -public abstract class MediaStreamingPackageBase { -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageParser.java deleted file mode 100644 index c6d386124cbe0..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingPackageParser.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.implementation.converters.MediaStreamingAudioDataConverter; -import com.azure.communication.callautomation.implementation.converters.MediaStreamingMetadataConverter; -import com.azure.core.util.BinaryData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.nio.charset.StandardCharsets; - -/** - * Parser of the different packages received as part of Media streaming. - */ -public final class MediaStreamingPackageParser { - private static final ClientLogger LOGGER = new ClientLogger(MediaStreamingPackageParser.class); - - /*** - * Parses a Media Streaming package from BinaryData. - * - * @param json The MediaStreaming package as a BinaryData object. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static MediaStreamingPackageBase parse(BinaryData json) { - return parse(json.toString()); - } - - /*** - * Parses a Media Streaming package from byte array. - * - * @param receivedBytes The MediaStreaming package as a byte[]. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static MediaStreamingPackageBase parse(byte[] receivedBytes) { - return parse(new String(receivedBytes, StandardCharsets.UTF_8)); - } - - /*** - * Parses a Media Streaming package from String. - * - * @param stringJson The MediaStreaming package as a String. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static MediaStreamingPackageBase parse(String stringJson) { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - JsonNode jsonData = mapper.readTree(stringJson); - if (stringJson.contains("AudioData")) { - MediaStreamingAudioDataConverter audioInternal = mapper.convertValue(jsonData.get("audioData"), MediaStreamingAudioDataConverter.class); - return new MediaStreamingAudioData(audioInternal.getData(), audioInternal.getTimestamp(), audioInternal.getParticipantRawID(), audioInternal.isSilent()); - } - if (stringJson.contains("AudioMetadata")) { - MediaStreamingMetadataConverter metadataInternal = mapper.convertValue(jsonData.get("audioMetadata"), MediaStreamingMetadataConverter.class); - return new MediaStreamingMetadata(metadataInternal.getMediaSubscriptionId(), metadataInternal.getEncoding(), metadataInternal.getSampleRate(), metadataInternal.getChannels(), metadataInternal.getLength()); - } - return null; - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } catch (JsonProcessingException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartTranscriptionOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartTranscriptionOptions.java new file mode 100644 index 0000000000000..b700482bdb6b7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartTranscriptionOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +/** + * Options for the Start Transcription operation. + */ +public class StartTranscriptionOptions { + + /** + * Defines Locale for the transcription e,g en-US. + */ + private String locale; + + /** + * The value to identify context of the operation. + */ + private String operationContext; + + /** + * Get the locale. + * + * @return locale. + */ + public String getLocale() { + return locale; + } + + /** + * Sets the locale. + * + * @param locale the incoming locale + * @return The StartTranscriptionOptions object. + */ + public StartTranscriptionOptions setLocale(String locale) { + this.locale = locale; + return this; + } + + /** + * Get the operation context. + * + * @return operation context. + */ + public String getOperationContext() { + return operationContext; + } + + /** + * Sets the operation context. + * + * @param operationContext Operation Context + * @return The StartTranscriptionOptions object. + */ + public StartTranscriptionOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StopTranscriptionOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StopTranscriptionOptions.java new file mode 100644 index 0000000000000..b66e1acc9b5c3 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StopTranscriptionOptions.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +/** + * Options for the Stop Transcription operation. + */ +public class StopTranscriptionOptions { + + /** + * The value to identify context of the operation. + */ + private String operationContext; + + + /** + * Get the operation context. + * + * @return operation context. + */ + public String getOperationContext() { + return operationContext; + } + + /** + * Sets the operation context. + * + * @param operationContext Operation Context + * @return The StopTranscriptionOptions object. + */ + public StopTranscriptionOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionOptions.java new file mode 100644 index 0000000000000..61e933bae40e9 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionOptions.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TranscriptionConfigurationInternal model. */ +@Fluent +public final class TranscriptionOptions { + /* + * Transport URL for live transcription + */ + @JsonProperty(value = "transportUrl", required = true) + private final String transportUrl; + + /* + * The type of transport to be used for live transcription, eg. Websocket + */ + @JsonProperty(value = "transportType", required = true) + private final TranscriptionTransportType transportType; + + /* + * Defines the locale for the data e.g en-CA, en-AU + */ + @JsonProperty(value = "locale", required = true) + private final String locale; + + /* + * Determines if the transcription should be started immediately after call is answered or not. + */ + @JsonProperty(value = "startTranscription", required = true) + private final boolean startTranscription; + + /** + * Creates a new instance of MediaStreamingConfiguration + * @param transportUrl - The Transport URL + * @param transportType - Transport type + * @param locale - Locale + * @param startTranscription - Start Transcription + */ + public TranscriptionOptions(String transportUrl, TranscriptionTransportType transportType, String locale, boolean startTranscription) { + this.transportUrl = transportUrl; + this.transportType = transportType; + this.locale = locale; + this.startTranscription = startTranscription; + } + + /** + * Get the transportUrl property: Transport URL for live transcription. + * + * @return the transportUrl value. + */ + public String getTransportUrl() { + return this.transportUrl; + } + + /** + * Get the transportType property: The type of transport to be used for live transcription, eg. Websocket. + * + * @return the transportType value. + */ + public TranscriptionTransportType getTransportType() { + return this.transportType; + } + + /** + * Get the locale property: locale for the data e.g en-CA, en-AU. + * + * @return the locale value. + */ + public String getLocale() { + return this.locale; + } + + /** + * Get the startTranscription property: Which determines if the transcription should be started immediately after call is answered or not. + * + * @return the startTranscription value. + */ + public boolean getStartTranscription() { + return this.startTranscription; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionTransportType.java similarity index 94% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportType.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionTransportType.java index 2078db6477565..8c6230b186419 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TranscriptionTransportType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.communication.callautomation.implementation.models; +package com.azure.communication.callautomation.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; @@ -19,7 +19,7 @@ public final class TranscriptionTransportType extends ExpandableStringEnum values() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java new file mode 100644 index 0000000000000..f4eeabcbbe1ee --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionFailed model. + */ +@Fluent +public final class TranscriptionFailed extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation") + private final ResultInformation resultInformation; + + /* + * Defines the result for TranscriptionUpdate with the current status and the details about the status + */ + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final TranscriptionUpdate transcriptionUpdateResult; + + /** + * Creates an instance of TranscriptionFailed class. + */ + public TranscriptionFailed() { + this.resultInformation = null; + this.transcriptionUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status + * and the details about the status. + * + * @return the transcriptionUpdateResult value. + */ + public TranscriptionUpdate getTranscriptionUpdateResult() { + return this.transcriptionUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java new file mode 100644 index 0000000000000..d810f59f7c2c7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionResumed model. + */ +@Fluent +public final class TranscriptionResumed extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private final ResultInformation resultInformation; + + /* + * Defines the result for TranscriptionUpdate with the current status and the details about the status + */ + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final TranscriptionUpdate transcriptionUpdateResult; + + /** + * Creates an instance of TranscriptionResumed class. + */ + public TranscriptionResumed() { + resultInformation = null; + transcriptionUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status + * and the details about the status. + * + * @return the transcriptionUpdateResult value. + */ + public TranscriptionUpdate getTranscriptionUpdateResult() { + return this.transcriptionUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java new file mode 100644 index 0000000000000..060157545a66d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionStarted model. + */ +@Fluent +public final class TranscriptionStarted extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private final ResultInformation resultInformation; + + /* + * Defines the result for TranscriptionUpdate with the current status and the details about the status + */ + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final TranscriptionUpdate transcriptionUpdateResult; + + /** + * Creates an instance of TranscriptionStarted class. + */ + public TranscriptionStarted() { + resultInformation = null; + transcriptionUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status + * and the details about the status. + * + * @return the transcriptionUpdateResult value. + */ + public TranscriptionUpdate getTranscriptionUpdateResult() { + return this.transcriptionUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java new file mode 100644 index 0000000000000..b00f8e0950049 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.Collection; + +/** + * Defines values for TranscriptionStatus. + */ +public final class TranscriptionStatus extends ExpandableStringEnum { + /** + * Static value transcriptionStarted for TranscriptionStatus. + */ + public static final TranscriptionStatus TRANSCRIPTION_STARTED = fromString("transcriptionStarted"); + + /** + * Static value transcriptionFailed for TranscriptionStatus. + */ + public static final TranscriptionStatus TRANSCRIPTION_FAILED = fromString("transcriptionFailed"); + + /** + * Static value transcriptionResumed for TranscriptionStatus. + */ + public static final TranscriptionStatus TRANSCRIPTION_RESUMED = fromString("transcriptionResumed"); + + /** + * Static value transcriptionLocaleUpdated for TranscriptionStatus. + */ + public static final TranscriptionStatus TRANSCRIPTION_LOCALE_UPDATED = fromString("transcriptionLocaleUpdated"); + + /** + * Static value transcriptionStopped for TranscriptionStatus. + */ + public static final TranscriptionStatus TRANSCRIPTION_STOPPED = fromString("transcriptionStopped"); + + /** + * Static value unspecifiedError for TranscriptionStatus. + */ + public static final TranscriptionStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** + * Creates a new instance of TranscriptionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TranscriptionStatus() { + } + + /** + * Creates or finds a TranscriptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TranscriptionStatus. + */ + @JsonCreator + public static TranscriptionStatus fromString(String name) { + return fromString(name, TranscriptionStatus.class); + } + + /** + * Gets known TranscriptionStatus values. + * + * @return known TranscriptionStatus values. + */ + public static Collection values() { + return values(TranscriptionStatus.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java new file mode 100644 index 0000000000000..351d299e2a6a8 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.Collection; + +/** + * Defines values for TranscriptionStatusDetails. + */ +public final class TranscriptionStatusDetails extends ExpandableStringEnum { + /** + * Static value subscriptionStarted for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); + + /** + * Static value streamConnectionReestablished for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_REESTABLISHED + = fromString("streamConnectionReestablished"); + + /** + * Static value streamConnectionUnsuccessful for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_UNSUCCESSFUL + = fromString("streamConnectionUnsuccessful"); + + /** + * Static value streamUrlMissing for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); + + /** + * Static value serviceShutdown for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); + + /** + * Static value streamConnectionInterrupted for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails STREAM_CONNECTION_INTERRUPTED + = fromString("streamConnectionInterrupted"); + + /** + * Static value speechServicesConnectionError for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails SPEECH_SERVICES_CONNECTION_ERROR + = fromString("speechServicesConnectionError"); + + /** + * Static value subscriptionStopped for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); + + /** + * Static value unspecifiedError for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** + * Creates a new instance of TranscriptionStatusDetails value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TranscriptionStatusDetails() { + } + + /** + * Creates or finds a TranscriptionStatusDetails from its string representation. + * + * @param name a name to look for. + * @return the corresponding TranscriptionStatusDetails. + */ + @JsonCreator + public static TranscriptionStatusDetails fromString(String name) { + return fromString(name, TranscriptionStatusDetails.class); + } + + /** + * Gets known TranscriptionStatusDetails values. + * + * @return known TranscriptionStatusDetails values. + */ + public static Collection values() { + return values(TranscriptionStatusDetails.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java new file mode 100644 index 0000000000000..c41373ffbaacd --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionStopped model. + */ +@Fluent +public final class TranscriptionStopped extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private final ResultInformation resultInformation; + + /* + * Defines the result for TranscriptionUpdate with the current status and the details about the status + */ + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final TranscriptionUpdate transcriptionUpdateResult; + + /** + * Creates an instance of TranscriptionStopped class. + */ + public TranscriptionStopped() { + resultInformation = null; + transcriptionUpdateResult = null; + } + + /** + * Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status + * and the details about the status. + * + * @return the transcriptionUpdateResult value. + */ + public TranscriptionUpdate getTranscriptionUpdateResult() { + return this.transcriptionUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java new file mode 100644 index 0000000000000..ff510421c2030 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionUpdate model. + */ +@Fluent +public final class TranscriptionUpdate { + /* + * The transcriptionStatus property. + */ + @JsonProperty(value = "transcriptionStatus") + private TranscriptionStatus transcriptionStatus; + + /* + * The transcriptionStatusDetails property. + */ + @JsonProperty(value = "transcriptionStatusDetails") + private TranscriptionStatusDetails transcriptionStatusDetails; + + /** + * Creates an instance of TranscriptionUpdate class. + */ + public TranscriptionUpdate() { + } + + /** + * Get the transcriptionStatus property: The transcriptionStatus property. + * + * @return the transcriptionStatus value. + */ + public TranscriptionStatus getTranscriptionStatus() { + return this.transcriptionStatus; + } + + /** + * Set the transcriptionStatus property: The transcriptionStatus property. + * + * @param transcriptionStatus the transcriptionStatus value to set. + * @return the TranscriptionUpdate object itself. + */ + public TranscriptionUpdate setTranscriptionStatus(TranscriptionStatus transcriptionStatus) { + this.transcriptionStatus = transcriptionStatus; + return this; + } + + /** + * Get the transcriptionStatusDetails property: The transcriptionStatusDetails property. + * + * @return the transcriptionStatusDetails value. + */ + public TranscriptionStatusDetails getTranscriptionStatusDetails() { + return this.transcriptionStatusDetails; + } + + /** + * Set the transcriptionStatusDetails property: The transcriptionStatusDetails property. + * + * @param transcriptionStatusDetails the transcriptionStatusDetails value to set. + * @return the TranscriptionUpdate object itself. + */ + public TranscriptionUpdate setTranscriptionStatusDetails(TranscriptionStatusDetails transcriptionStatusDetails) { + this.transcriptionStatusDetails = transcriptionStatusDetails; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java new file mode 100644 index 0000000000000..e762737ffb6e7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TranscriptionUpdated model. + */ +@Fluent +public final class TranscriptionUpdated extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private final ResultInformation resultInformation; + + /* + * Defines the result for TranscriptionUpdate with the current status and the details about the status + */ + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final TranscriptionUpdate transcriptionUpdateResult; + + /** + * Creates an instance of TranscriptionUpdated class. + */ + public TranscriptionUpdated() { + resultInformation = null; + transcriptionUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status + * and the details about the status. + * + * @return the transcriptionUpdateResult value. + */ + public TranscriptionUpdate getTranscriptionUpdateResult() { + return this.transcriptionUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java index 0d0e94ffdbeab..91a5fa7fc254e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for AzureCommunicationCallAutomationService. - * Azure Communication Service Call Automation APIs. + * Package containing classes for AzureCommunicationCallAutomationService. Azure Communication Service Call Automation + * APIs. */ package com.azure.communication.callautomation.models; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java new file mode 100644 index 0000000000000..09374d3615d53 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming; + +/** The abstract classed used as parent of Streaming data such as Audio, Transcription or Captions. */ +public abstract class StreamingData { +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java new file mode 100644 index 0000000000000..0b987e4a6b551 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming; + +import com.azure.communication.callautomation.implementation.converters.AudioDataConverter; +import com.azure.communication.callautomation.implementation.converters.AudioMetadataConverter; +import com.azure.communication.callautomation.implementation.converters.TranscriptionDataConverter; +import com.azure.communication.callautomation.implementation.converters.TranscriptionMetadataConverter; +import com.azure.communication.callautomation.models.streaming.media.AudioData; +import com.azure.communication.callautomation.models.streaming.media.AudioMetadata; +import com.azure.communication.callautomation.models.streaming.transcription.TranscriptionData; +import com.azure.communication.callautomation.models.streaming.transcription.TranscriptionMetadata; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.nio.charset.StandardCharsets; + +/** + * A generic parser for different packages, such as Media(Audio) or Transcription, received as + * part of streaming over websocket + */ +public final class StreamingDataParser { + private static final ClientLogger LOGGER = new ClientLogger(StreamingDataParser.class); + + /*** + * Parses StreamingData such as Audio, Transcription or Captions from BinaryData. + * + * @param json The MediaStreaming package as a BinaryData object. + * @throws RuntimeException Any exceptions occur at runtime. + * @return a MediaStreamingPackageBase object. + */ + public static StreamingData parse(BinaryData json) { + return parse(json.toString()); + } + + /*** + * Parses a StreamingData such as Audio, Transcription or Captions from byte array. + * + * @param receivedBytes The MediaStreaming package as a byte[]. + * @throws RuntimeException Any exceptions occur at runtime. + * @return a MediaStreamingPackageBase object. + */ + public static StreamingData parse(byte[] receivedBytes) { + return parse(new String(receivedBytes, StandardCharsets.UTF_8)); + } + + /*** + * Parses a StreamingData such as Audio, Transcription or Captions from String. + * + * @param stringJson The MediaStreaming package as a String. + * @throws RuntimeException Any exceptions occur at runtime. + * @return a MediaStreamingPackageBase object. + */ + public static StreamingData parse(String stringJson) { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + JsonNode jsonData = mapper.readTree(stringJson); + + //region Audio + if (stringJson.contains("AudioData")) { + AudioDataConverter audioInternal = mapper.convertValue(jsonData.get("audioData"), AudioDataConverter.class); + return new AudioData(audioInternal.getData(), audioInternal.getTimestamp(), audioInternal.getParticipantRawID(), audioInternal.isSilent()); + } + if (stringJson.contains("AudioMetadata")) { + AudioMetadataConverter metadataInternal = mapper.convertValue(jsonData.get("audioMetadata"), AudioMetadataConverter.class); + return new AudioMetadata(metadataInternal.getMediaSubscriptionId(), metadataInternal.getEncoding(), metadataInternal.getSampleRate(), metadataInternal.getChannels(), metadataInternal.getLength()); + } + //endregion + + //region Transcription + if (stringJson.contains("TranscriptionData")) { + TranscriptionDataConverter transcriptionInternal = mapper.convertValue(jsonData.get("transcriptionData"), TranscriptionDataConverter.class); + return new TranscriptionData(transcriptionInternal.getText(), transcriptionInternal.getFormat(), transcriptionInternal.getConfidence(), transcriptionInternal.getOffset(), transcriptionInternal.getWords(), transcriptionInternal.getParticipantRawID(), transcriptionInternal.getResultStatus()); + } + if (stringJson.contains("TranscriptionMetadata")) { + TranscriptionMetadataConverter transcriptionMetadataInternal = mapper.convertValue(jsonData.get("transcriptionMetadata"), TranscriptionMetadataConverter.class); + return new TranscriptionMetadata(transcriptionMetadataInternal.getTranscriptionSubscriptionId(), transcriptionMetadataInternal.getLocale(), transcriptionMetadataInternal.getCallConnectionId(), transcriptionMetadataInternal.getCorrelationId()); + } + //endregion + + return null; + } catch (RuntimeException e) { + throw LOGGER.logExceptionAsError(e); + } catch (JsonProcessingException e) { + throw LOGGER.logExceptionAsError(new RuntimeException(e)); + } + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java similarity index 87% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioData.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java index a8f004994482d..e96ec71bc3f63 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioData.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.communication.callautomation.models; +package com.azure.communication.callautomation.models.streaming.media; +import com.azure.communication.callautomation.models.streaming.StreamingData; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; @@ -10,7 +11,7 @@ import java.time.format.DateTimeFormatter; /** The MediaStreamingAudio model. */ -public final class MediaStreamingAudioData extends MediaStreamingPackageBase { +public final class AudioData extends StreamingData { /* * The audio data. @@ -40,7 +41,7 @@ public final class MediaStreamingAudioData extends MediaStreamingPackageBase { * @param participantRawID The participantId. * @param silent Indicates if the received audio buffer contains only silence. */ - MediaStreamingAudioData(String data, String timestamp, String participantRawID, boolean silent) { + public AudioData(String data, String timestamp, String participantRawID, boolean silent) { this.data = data; this.timestamp = OffsetDateTime.parse(timestamp, DateTimeFormatter.ISO_OFFSET_DATE_TIME); if (participantRawID != null && !participantRawID.isEmpty()) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingMetadata.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java similarity index 84% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingMetadata.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java index 2abd357dfe11b..41503a385405a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingMetadata.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.communication.callautomation.models; +package com.azure.communication.callautomation.models.streaming.media; + +import com.azure.communication.callautomation.models.streaming.StreamingData; /** The MediaStreamingMetadata model. */ -public final class MediaStreamingMetadata extends MediaStreamingPackageBase { +public final class AudioMetadata extends StreamingData { /* * The mediaSubscriptionId. @@ -40,7 +42,7 @@ public final class MediaStreamingMetadata extends MediaStreamingPackageBase { * @param channels The channels. * @param length The length. */ - MediaStreamingMetadata(String mediaSubscriptionId, String encoding, int sampleRate, int channels, int length) { + public AudioMetadata(String mediaSubscriptionId, String encoding, int sampleRate, int channels, int length) { this.mediaSubscriptionId = mediaSubscriptionId; this.encoding = encoding; this.sampleRate = sampleRate; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java new file mode 100644 index 0000000000000..4ccc2863a62a0 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** Package containing websocket models for Media Streaming. null. */ +package com.azure.communication.callautomation.models.streaming.media; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java new file mode 100644 index 0000000000000..3ac68832f269d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** Package containing websocket models for streaming data such Media Streaming, Transcription or Live Caption. null. */ +package com.azure.communication.callautomation.models.streaming; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java new file mode 100644 index 0000000000000..cdf989f4c89f8 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming.transcription; + +/** + * The status of the result of transcription + */ +public enum ResultStatus { + + /** + * Intermediate result + */ + INTERMEDIATE, + + /** + * Final result + */ + FINAL +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java new file mode 100644 index 0000000000000..e3b3545b487d2 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming.transcription; + +/** + * The format of transcription text + */ +public enum TextFormat { + + /** + * Formatted recognize text with punctuations + */ + DISPLAY +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java new file mode 100644 index 0000000000000..5b36ad596650a --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming.transcription; + +import com.azure.communication.callautomation.models.streaming.StreamingData; +import com.azure.communication.common.CommunicationIdentifier; +import com.azure.communication.common.CommunicationUserIdentifier; +import com.azure.core.util.logging.ClientLogger; + +import java.util.List; + +/** + * The TranscriptionData model. + */ +public final class TranscriptionData extends StreamingData { + + private static final ClientLogger LOGGER = new ClientLogger(TranscriptionData.class); + + /* + * The display form of the recognized word + */ + private final String text; + + /* + * The format of text + */ + private final TextFormat format; + + /* + * Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) + */ + private final double confidence; + + /* + * The position of this payload + */ + private final long offset; + + /* + * The result for each word of the phrase + */ + private final List words; + + /* + * The identified speaker based on participant raw ID + */ + private final CommunicationIdentifier participant; + + /** + * Status of the result of transcription + */ + private final ResultStatus resultStatus; + + /** + * The TranscriptionData constructor + * + * @param text The display form of the recognized word + * @param format The format of text + * @param confidence Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) + * @param offset The position of this payload + * @param words The result for each word of the phrase + * @param participantRawID The identified speaker based on participant raw ID + * @param resultStatus Status of the result of transcription + */ + public TranscriptionData(String text, String format, double confidence, long offset, List words, String participantRawID, String resultStatus) { + this.text = text; + this.format = convertToTextFormatEnum(format); + this.confidence = confidence; + this.offset = offset; + this.words = words; + if (participantRawID != null && !participantRawID.isEmpty()) { + this.participant = new CommunicationUserIdentifier(participantRawID); + } else { + participant = null; + } + this.resultStatus = convertToResultStatusEnum(resultStatus); + } + + private ResultStatus convertToResultStatusEnum(String resultStatus) { + if ("Intermediate".equalsIgnoreCase(resultStatus)) { + return ResultStatus.INTERMEDIATE; + } else if ("Final".equalsIgnoreCase(resultStatus)) { + return ResultStatus.FINAL; + } else { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(resultStatus)); + + } + } + + private TextFormat convertToTextFormatEnum(String format) { + if ("Display".equalsIgnoreCase(format)) { + return TextFormat.DISPLAY; + } else { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(format)); + } + } + + /** + * Get the text property. + * + * @return the text value. + */ + public String getText() { + return text; + } + + /** + * Get the format property. + * + * @return the format value. + */ + public TextFormat getFormat() { + return format; + } + + /** + * Get the confidence property. + * + * @return the confidence value. + */ + public double getConfidence() { + return confidence; + } + + /** + * Get the offset property. + * + * @return the offset value. + */ + public Long getOffset() { + return offset; + } + + /** + * Get the words property. + * + * @return the words value. + */ + public List getWords() { + return words; + } + + /** + * Get the participantRawID property. + * + * @return the participantRawID value. + */ + public CommunicationIdentifier getParticipant() { + return participant; + } + + /** + * Get the resultStatus property. + * + * @return the resultStatus value. + */ + public ResultStatus getResultStatus() { + return resultStatus; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java new file mode 100644 index 0000000000000..1a6641772bded --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming.transcription; + +import com.azure.communication.callautomation.models.streaming.StreamingData; + +/** + * Metadata for Transcription Streaming. + */ +public final class TranscriptionMetadata extends StreamingData { + + + /* + * Transcription Subscription Id. + */ + private final String transcriptionSubscriptionId; + + /* + * The target locale in which the translated text needs to be + */ + private final String locale; + + /* + * Call connection id + */ + private final String callConnectionId; + + /* + * Correlation id + */ + private final String correlationId; + + /** + * Creates an instance of TranscriptionMetadata class. + * @param transcriptionSubscriptionId Transcription Subscription Id. + * @param locale The target locale in which the translated text needs to be + * @param callConnectionId Call connection id + * @param correlationId Correlation id + */ + public TranscriptionMetadata(String transcriptionSubscriptionId, String locale, String callConnectionId, String correlationId) { + this.transcriptionSubscriptionId = transcriptionSubscriptionId; + this.locale = locale; + this.callConnectionId = callConnectionId; + this.correlationId = correlationId; + } + + /** + * Get the transcriptionSubscriptionId property. + * + * @return the transcriptionSubscriptionId value. + */ + public String getTranscriptionSubscriptionId() { + return transcriptionSubscriptionId; + } + + /** + * Get the locale property. + * + * @return the locale value. + */ + public String getLocale() { + return locale; + } + + /** + * Get the callConnectionId property. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return callConnectionId; + } + + /** + * Get the correlationId property. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return correlationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java new file mode 100644 index 0000000000000..6945ed30154d0 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.streaming.transcription; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result for each word of the phrase + */ +public class Word { + + /* + * Text in the phrase. + */ + @JsonProperty(value = "text") + private String text; + + /* + * The word's position within the phrase. + */ + @JsonProperty(value = "offset") + private long offset; + + /** + * Get the text property. + * + * @return the text value. + */ + public String getText() { + return text; + } + + /** + * Get the offset property. + * + * @return the offset value. + */ + public long getOffset() { + return offset; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java new file mode 100644 index 0000000000000..ba9eb057e8e45 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** Package containing websocket models for Transcription. null. */ +package com.azure.communication.callautomation.models.streaming.transcription; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java index 999f8cebfc93f..42bdba18262df 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java @@ -17,4 +17,10 @@ opens com.azure.communication.callautomation.models to com.azure.core, com.fasterxml.jackson.databind; opens com.azure.communication.callautomation.models.events to com.fasterxml.jackson.databind; opens com.azure.communication.callautomation.implementation.converters to com.azure.core, com.fasterxml.jackson.databind; + exports com.azure.communication.callautomation.models.streaming.media; + opens com.azure.communication.callautomation.models.streaming.media to com.azure.core, com.fasterxml.jackson.databind; + exports com.azure.communication.callautomation.models.streaming; + opens com.azure.communication.callautomation.models.streaming to com.azure.core, com.fasterxml.jackson.databind; + exports com.azure.communication.callautomation.models.streaming.transcription; + opens com.azure.communication.callautomation.models.streaming.transcription to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java index 2b1c2d0cdb5ad..14ad80ed2c250 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java @@ -31,7 +31,7 @@ public void createGroupCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) ))); CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier(CALL_TARGET_ID)); @@ -44,7 +44,7 @@ public void createCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -57,19 +57,21 @@ public void createGroupCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); CreateGroupCallOptions callOptions = new CreateGroupCallOptions(targets, CALL_CALLBACK_URL); callOptions.setOperationContext(CALL_SUBJECT); callOptions.setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); + callOptions.setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); Response createCallResult = callAutomationAsyncClient.createGroupCallWithResponse(callOptions).block(); assertNotNull(createCallResult); assertEquals(201, createCallResult.getStatusCode()); assertNotNull(createCallResult.getValue()); - assertEquals("mediaSubscriptionId", createCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(MEDIA_SUBSCRIPTION_ID, createCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(DATA_SUBSCRIPTION_ID, createCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test @@ -77,13 +79,13 @@ public void createCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) ))); - //List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier(CALL_TARGET_ID)); CreateCallOptions callOptions = new CreateCallOptions(callInvite, CALL_CALLBACK_URL); callOptions.setOperationContext(CALL_SUBJECT); callOptions.setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); + callOptions.setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); Response createCallResult = callAutomationAsyncClient.createCallWithResponse(callOptions).block(); @@ -98,7 +100,7 @@ public void answerCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 200) ))); AnswerCallResult answerCallResult = callAutomationAsyncClient.answerCall(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL).block(); @@ -111,18 +113,21 @@ public void answerCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))); AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL) - .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); + .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION) + .setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); + Response answerCallResult = callAutomationAsyncClient.answerCallWithResponse( answerCallOptions).block(); assertNotNull(answerCallResult); assertEquals(200, answerCallResult.getStatusCode()); assertNotNull(answerCallResult.getValue()); - assertEquals("mediaSubscriptionId", answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(MEDIA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(DATA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java index 09d21edf27da0..31705ac84099d 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java @@ -35,7 +35,7 @@ public void createCall() { CallAutomationClient callAutomationClient = getCallAutomationClientWithSourceIdentity(caller, new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -49,7 +49,7 @@ public void createCallWithResponse() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) ))); CommunicationUserIdentifier caller = new CommunicationUserIdentifier(CALL_CALLER_ID); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -69,7 +69,7 @@ public void answerCall() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))); AnswerCallResult answerCallResult = callAutomationClient.answerCall(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL); @@ -82,11 +82,12 @@ public void answerCallWithResponse() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))); AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL) - .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); + .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION) + .setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); Response answerCallResult = callAutomationClient.answerCallWithResponse( answerCallOptions, Context.NONE); @@ -94,7 +95,8 @@ public void answerCallWithResponse() { assertNotNull(answerCallResult); assertEquals(200, answerCallResult.getStatusCode()); assertNotNull(answerCallResult.getValue()); - assertEquals("mediaSubscriptionId", answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(MEDIA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); + assertEquals(DATA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java index 6b2cbf1f8ee92..c057512623432 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java @@ -7,11 +7,11 @@ import com.azure.communication.callautomation.models.DtmfResult; import com.azure.communication.callautomation.models.RecognizeResult; import com.azure.communication.callautomation.models.RecordingState; -import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.communication.callautomation.models.events.CallConnected; import com.azure.communication.callautomation.models.events.CallTransferAccepted; import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; +import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionStopped; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneFailed; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneReceived; @@ -37,6 +37,13 @@ import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; +import com.azure.communication.callautomation.models.events.TranscriptionFailed; +import com.azure.communication.callautomation.models.events.TranscriptionResumed; +import com.azure.communication.callautomation.models.events.TranscriptionStarted; +import com.azure.communication.callautomation.models.events.TranscriptionStatus; +import com.azure.communication.callautomation.models.events.TranscriptionStatusDetails; +import com.azure.communication.callautomation.models.events.TranscriptionStopped; +import com.azure.communication.callautomation.models.events.TranscriptionUpdated; import org.junit.jupiter.api.Test; import java.util.List; @@ -1025,4 +1032,222 @@ public void parseDialogTransferEvent() { assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); } + + @Test + public void parseTranscriptionStartedEvent() { + String receivedEvent = "[" + + " {\n" + + " \"id\": \"Sanitized\",\n" + + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"type\": \"Microsoft.Communication.TranscriptionStarted\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 200,\n" + + " \"subCode\": 0,\n" + + " \"message\": \"Transcription started successfully.\"\n" + + " },\n" + + " \"transcriptionUpdate\": {\n" + + " \"transcriptionStatus\": \"transcriptionStarted\",\n" + + " \"transcriptionStatusDetails\": \"subscriptionStarted\"\n" + + " },\n" + + " \"version\": \"2023-01-15-preview\",\n" + + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" + + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" + + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" + + " \"publicEventType\": \"Microsoft.Communication.TranscriptionStarted\"\n" + + " },\n" + + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" + + "}]"; + + + TranscriptionStarted event = (TranscriptionStarted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); + assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); + assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); + assertEquals("Transcription started successfully.", event.getResultInformation().getMessage()); + + assertNotNull(event.getTranscriptionUpdateResult()); + assertEquals(TranscriptionStatus.TRANSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); + assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); + } + @Test + public void parseTranscriptionResumedEvent() { + String receivedEvent = "[" + + " {\n" + + " \"id\": \"Sanitized\",\n" + + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"type\": \"Microsoft.Communication.TranscriptionResumed\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 200,\n" + + " \"subCode\": 0,\n" + + " \"message\": \"Transcription resumed.\"\n" + + " },\n" + + " \"transcriptionUpdate\": {\n" + + " \"transcriptionStatus\": \"transcriptionResumed\",\n" + + " \"transcriptionStatusDetails\": \"streamConnectionReestablished\"\n" + + " },\n" + + " \"version\": \"2023-01-15-preview\",\n" + + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" + + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" + + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" + + " \"publicEventType\": \"icrosoft.Communication.TranscriptionResumed\"\n" + + " },\n" + + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" + + "}]"; + + + TranscriptionResumed event = (TranscriptionResumed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); + assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); + assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); + assertEquals("Transcription resumed.", event.getResultInformation().getMessage()); + + assertNotNull(event.getTranscriptionUpdateResult()); + assertEquals(TranscriptionStatus.TRANSCRIPTION_RESUMED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); + assertEquals(TranscriptionStatusDetails.STREAM_CONNECTION_REESTABLISHED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); + } + @Test + public void parseTranscriptionStoppedEvent() { + String receivedEvent = "[" + + " {\n" + + " \"id\": \"Sanitized\",\n" + + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"type\": \"Microsoft.Communication.TranscriptionStopped\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 200,\n" + + " \"subCode\": 0,\n" + + " \"message\": \"Transcription stopped.\"\n" + + " },\n" + + " \"transcriptionUpdate\": {\n" + + " \"transcriptionStatus\": \"transcriptionStopped\",\n" + + " \"transcriptionStatusDetails\": \"subscriptionStopped\"\n" + + " },\n" + + " \"version\": \"2023-01-15-preview\",\n" + + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" + + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" + + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" + + " \"publicEventType\": \"icrosoft.Communication.TranscriptionStopped\"\n" + + " },\n" + + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" + + "}]"; + + + TranscriptionStopped event = (TranscriptionStopped) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); + assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); + assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); + assertEquals("Transcription stopped.", event.getResultInformation().getMessage()); + + assertNotNull(event.getTranscriptionUpdateResult()); + assertEquals(TranscriptionStatus.TRANSCRIPTION_STOPPED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); + assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STOPPED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); + } + @Test + public void parseTranscriptionFailedEvent() { + String receivedEvent = "[" + + " {\n" + + " \"id\": \"Sanitized\",\n" + + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"type\": \"Microsoft.Communication.TranscriptionFailed\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 500,\n" + + " \"subCode\": 9999,\n" + + " \"message\": \"Unknown internal server error.\"\n" + + " },\n" + + " \"transcriptionUpdate\": {\n" + + " \"transcriptionStatus\": \"transcriptionFailed\",\n" + + " \"transcriptionStatusDetails\": \"unspecifiedError\"\n" + + " },\n" + + " \"version\": \"2023-01-15-preview\",\n" + + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" + + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" + + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" + + " \"publicEventType\": \"icrosoft.Communication.TranscriptionFailed\"\n" + + " },\n" + + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" + + "}]"; + + + TranscriptionFailed event = (TranscriptionFailed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); + assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); + assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); + assertEquals("Unknown internal server error.", event.getResultInformation().getMessage()); + + assertNotNull(event.getTranscriptionUpdateResult()); + assertEquals(TranscriptionStatus.TRANSCRIPTION_FAILED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); + assertEquals(TranscriptionStatusDetails.UNSPECIFIED_ERROR, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); + } + + + @Test + public void parseTranscriptionUpdatedEvent() { + String receivedEvent = "[" + + " {\n" + + " \"id\": \"Sanitized\",\n" + + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"type\": \"Microsoft.Communication.TranscriptionUpdated\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 200,\n" + + " \"subCode\": 0,\n" + + " \"message\": \"Transcription updated.\"\n" + + " },\n" + + " \"transcriptionUpdate\": {\n" + + " \"transcriptionStatus\": \"transcriptionLocaleUpdated\",\n" + + " \"transcriptionStatusDetails\": \"subscriptionStarted\"\n" + + " },\n" + + " \"version\": \"2023-01-15-preview\",\n" + + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" + + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" + + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" + + " \"publicEventType\": \"Microsoft.Communication.TranscriptionUpdated\"\n" + + " },\n" + + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" + + "}]"; + + + TranscriptionUpdated event = (TranscriptionUpdated) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); + assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); + assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); + assertEquals("Transcription updated.", event.getResultInformation().getMessage()); + + assertNotNull(event.getTranscriptionUpdateResult()); + assertEquals(TranscriptionStatus.TRANSCRIPTION_LOCALE_UPDATED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); + assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java index 29a8c2dfd0d5d..23b6babc925ef 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java @@ -20,6 +20,8 @@ import com.azure.communication.callautomation.models.MediaStreamingOptions; import com.azure.communication.callautomation.models.MediaStreamingContent; import com.azure.communication.callautomation.models.MediaStreamingTransport; +import com.azure.communication.callautomation.models.TranscriptionOptions; +import com.azure.communication.callautomation.models.TranscriptionTransportType; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -47,6 +49,7 @@ public class CallAutomationUnitTestBase { static final String CALL_INCOMING_CALL_CONTEXT = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.REDACTED"; static final String CALL_OPERATION_CONTEXT = "operationContext"; static final String MEDIA_SUBSCRIPTION_ID = "mediaSubscriptionId"; + static final String DATA_SUBSCRIPTION_ID = "dataSubscriptionId"; static final String DIALOG_ID = "dialogId"; static final String BOT_APP_ID = "botAppId"; @@ -57,19 +60,27 @@ public class CallAutomationUnitTestBase { MediaStreamingAudioChannel.MIXED ); + static final TranscriptionOptions TRANSCRIPTION_CONFIGURATION = new TranscriptionOptions( + "https://websocket.url.com", + TranscriptionTransportType.WEBSOCKET, + "en-US", + true + ); + public static String generateDownloadResult(String content) { return content; } public static String generateCallProperties(String callConnectionId, String serverCallId, String callerId, String callerDisplayName, String targetId, String connectionState, - String subject, String callbackUri, String mediaSubscriptionId) { + String subject, String callbackUri, String mediaSubscriptionId, String dataSubscriptionId) { CallConnectionPropertiesInternal result = new CallConnectionPropertiesInternal() .setCallConnectionId(callConnectionId) .setServerCallId(serverCallId) .setCallbackUri(callbackUri) .setCallConnectionState(CallConnectionStateModelInternal.fromString(connectionState)) .setMediaSubscriptionId(mediaSubscriptionId) + .setDataSubscriptionId(dataSubscriptionId) .setSourceDisplayName(callerDisplayName) .setTargets(new ArrayList<>(Collections.singletonList(ModelGenerator.generateUserIdentifierModel(targetId))) ); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java index 405f22bf46db0..ee07f6d91116f 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java @@ -44,7 +44,7 @@ public void getCallProperties() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -58,7 +58,7 @@ public void getCallPropertiesWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java index 12bd132e4b032..16c54acf0036a 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java @@ -44,7 +44,7 @@ public void getCallProperties() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))) .getCallConnection(CALL_CONNECTION_ID); @@ -58,7 +58,7 @@ public void getCallPropertiesWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) ))) .getCallConnection(CALL_CONNECTION_ID); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java index 29f78ea67c389..e1be011f6d699 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java @@ -3,8 +3,6 @@ package com.azure.communication.callautomation; -import com.azure.communication.callautomation.models.PlayToAllOptions; -import com.azure.communication.callautomation.models.RecognitionChoice; import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; import com.azure.communication.callautomation.models.CallMediaRecognizeChoiceOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeDtmfOptions; @@ -13,13 +11,17 @@ import com.azure.communication.callautomation.models.ContinuousDtmfRecognitionOptions; import com.azure.communication.callautomation.models.DtmfTone; import com.azure.communication.callautomation.models.FileSource; -import com.azure.communication.callautomation.models.VoiceKind; -import com.azure.communication.callautomation.models.StartHoldMusicOptions; -import com.azure.communication.callautomation.models.TextSource; -import com.azure.communication.callautomation.models.SsmlSource; import com.azure.communication.callautomation.models.PlayOptions; +import com.azure.communication.callautomation.models.PlayToAllOptions; +import com.azure.communication.callautomation.models.RecognitionChoice; import com.azure.communication.callautomation.models.RecognizeInputType; import com.azure.communication.callautomation.models.SendDtmfTonesOptions; +import com.azure.communication.callautomation.models.SsmlSource; +import com.azure.communication.callautomation.models.StartHoldMusicOptions; +import com.azure.communication.callautomation.models.StartTranscriptionOptions; +import com.azure.communication.callautomation.models.StopTranscriptionOptions; +import com.azure.communication.callautomation.models.TextSource; +import com.azure.communication.callautomation.models.VoiceKind; import com.azure.communication.common.CommunicationUserIdentifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -367,4 +369,35 @@ private CallMediaAsync getMockCallMedia(int expectedStatusCode) { ); return callConnection.getCallMediaAsync(); } + + @Test + public void startTranscriptionWithResponse() { + callMedia = getMockCallMedia(202); + StartTranscriptionOptions options = new StartTranscriptionOptions(); + options.setOperationContext("operationContext"); + options.setLocale("en-US"); + StepVerifier.create( + callMedia.startTranscriptionWithResponseAsync(options)) + .consumeNextWith(response -> assertEquals(202, response.getStatusCode()) + ) + .verifyComplete(); + } + @Test + public void stopTranscriptionWithResponse() { + callMedia = getMockCallMedia(202); + StopTranscriptionOptions options = new StopTranscriptionOptions(); + options.setOperationContext("operationContext"); + StepVerifier.create( + callMedia.stopTranscriptionWithResponseAsync(options) + ) + .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) + .verifyComplete(); + } + @Test + public void updateTranscriptionWithResponse() { + callMedia = getMockCallMedia(202); + StepVerifier.create( + callMedia.updateTranscription("en-US") + ).verifyComplete(); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java index 8e43e024c0487..b5d45bcf72e0b 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java @@ -193,4 +193,27 @@ public void stopHoldMusicWithResponseTest() { "operationalContext", Context.NONE); assertEquals(response.getStatusCode(), 200); } + + @Test + public void startTranscriptionWithResponse() { + StartTranscriptionOptions options = new StartTranscriptionOptions(); + options.setOperationContext("operationContext"); + options.setLocale("en-US"); + Response response = callMedia.startTranscriptionWithResponse(options, Context.NONE); + assertEquals(response.getStatusCode(), 202); + } + + @Test + public void stopTranscriptionWithResponse() { + StopTranscriptionOptions options = new StopTranscriptionOptions(); + options.setOperationContext("operationContext"); + Response response = callMedia.stopTranscriptionWithResponse(options, Context.NONE); + assertEquals(response.getStatusCode(), 202); + } + + @Test + public void updateTranscriptionWithResponse() { + Response response = callMedia.updateTranscriptionWithResponse("en-US", Context.NONE); + assertEquals(response.getStatusCode(), 202); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/MediaStreamingPackageParserUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/MediaStreamingPackageParserUnitTests.java deleted file mode 100644 index 4999fade4d99b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/MediaStreamingPackageParserUnitTests.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.MediaStreamingAudioData; -import com.azure.communication.callautomation.models.MediaStreamingMetadata; -import com.azure.communication.callautomation.models.MediaStreamingPackageParser; -import com.azure.core.util.BinaryData; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; - -public class MediaStreamingPackageParserUnitTests { - @Test - public void parseAudioData() { - String audioJson = "{" - + "\"kind\": \"AudioData\"," - + "\"audioData\": {" - + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," - + "\"participantRawID\": \"participantId\"," - + "\"data\": \"AQIDBAU=\"," - + "\"silent\": false" - + "}" - + "}"; - MediaStreamingAudioData mediaStreamingAudioData = (MediaStreamingAudioData) MediaStreamingPackageParser.parse(audioJson); - assertNotNull(mediaStreamingAudioData); - checkAudioData(mediaStreamingAudioData); - } - - @Test - public void parseAudioDataNoParticipantNoSilent() { - String audioJson = "{" - + "\"kind\": \"AudioData\"," - + "\"audioData\": {" - + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," - + "\"data\": \"AQIDBAU=\"" - + "}" - + "}"; - MediaStreamingAudioData mediaStreamingAudioData = (MediaStreamingAudioData) MediaStreamingPackageParser.parse(audioJson); - assertNotNull(mediaStreamingAudioData); - checkAudioDataNoParticipant(mediaStreamingAudioData); - } - - @Test - public void parseAudioMetadata() { - String metadataJson = "{" - + " \"kind\": \"AudioMetadata\"," - + "\"audioMetadata\": {" - + "\"subscriptionId\": \"subscriptionId\"," - + "\"encoding\": \"PCM\"," - + "\"sampleRate\": 8," - + "\"channels\": 2," - + "\"length\": 100" - + "}" - + "}"; - MediaStreamingMetadata mediaStreamingMetadata = (MediaStreamingMetadata) MediaStreamingPackageParser.parse(metadataJson); - assertNotNull(mediaStreamingMetadata); - checkAudioMetadata(mediaStreamingMetadata); - } - - @Test - public void parseBinaryAudioData() { - String jsonData = createJsonData(); - MediaStreamingAudioData mediaStreamingAudioData = (MediaStreamingAudioData) MediaStreamingPackageParser.parse(BinaryData.fromString(jsonData)); - checkAudioData(mediaStreamingAudioData); - } - - @Test - public void parseBinaryAudioMetadata() { - String jsonMetadata = createJsonMetadata(); - MediaStreamingMetadata mediaStreamingMetadata = (MediaStreamingMetadata) MediaStreamingPackageParser.parse(BinaryData.fromString(jsonMetadata)); - checkAudioMetadata(mediaStreamingMetadata); - } - - @Test - public void parseBinaryArrayAudioData() { - String jsonData = createJsonData(); - MediaStreamingAudioData mediaStreamingAudioData = (MediaStreamingAudioData) MediaStreamingPackageParser.parse(jsonData.getBytes(StandardCharsets.UTF_8)); - checkAudioData(mediaStreamingAudioData); - } - - @Test - public void parseBinaryArrayAudioMetadata() { - String jsonMetadata = createJsonMetadata(); - MediaStreamingMetadata mediaStreamingMetadata = (MediaStreamingMetadata) MediaStreamingPackageParser.parse(jsonMetadata.getBytes(StandardCharsets.UTF_8)); - checkAudioMetadata(mediaStreamingMetadata); - } - - private void checkAudioData(MediaStreamingAudioData mediaStreamingAudio) { - assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); - assertEquals("participantId", mediaStreamingAudio.getParticipant().getRawId()); - assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); - assertFalse(mediaStreamingAudio.isSilent()); - } - - private void checkAudioDataNoParticipant(MediaStreamingAudioData mediaStreamingAudio) { - assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); - assertNull(mediaStreamingAudio.getParticipant()); - assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); - assertFalse(mediaStreamingAudio.isSilent()); - } - - private void checkAudioMetadata(MediaStreamingMetadata mediaStreamingMetadata) { - assertEquals("subscriptionId", mediaStreamingMetadata.getMediaSubscriptionId()); - assertEquals("PCM", mediaStreamingMetadata.getEncoding()); - assertEquals(8, mediaStreamingMetadata.getSampleRate()); - assertEquals(2, mediaStreamingMetadata.getChannels()); - assertEquals(100, mediaStreamingMetadata.getLength()); - } - - private String createJsonMetadata() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode audioMetadata = objectMapper.createObjectNode(); - audioMetadata.put("kind", "AudioMetadata"); - audioMetadata.put("subscriptionId", "subscriptionId"); - audioMetadata.put("encoding", "PCM"); - audioMetadata.put("sampleRate", 8); - audioMetadata.put("channels", 2); - audioMetadata.put("length", 100); - ObjectNode root = objectMapper.createObjectNode(); - root.put("kind", "AudioMetadata"); - root.put("audioMetadata", audioMetadata); - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); - } catch (Exception e) { - throw new RuntimeException(); - } - } - - private String createJsonData() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode audioData = objectMapper.createObjectNode(); - audioData.put("kind", "AudioData"); - audioData.put("timestamp", "2022-10-03T19:16:12.925Z"); - audioData.put("participantRawID", "participantId"); - audioData.put("data", "AQIDBAU="); - audioData.put("silent", false); - ObjectNode root = objectMapper.createObjectNode(); - root.put("kind", "AudioData"); - root.put("audioData", audioData); - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); - } catch (Exception e) { - throw new RuntimeException(); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java new file mode 100644 index 0000000000000..547811ee19b6f --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation; + +import com.azure.communication.callautomation.models.streaming.StreamingDataParser; +import com.azure.communication.callautomation.models.streaming.media.AudioData; +import com.azure.communication.callautomation.models.streaming.media.AudioMetadata; +import com.azure.communication.callautomation.models.streaming.transcription.*; +import com.azure.core.util.BinaryData; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.junit.jupiter.api.Test; + +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +public class StreamingDataParserUnitTests { + //region Audio + @Test + public void parseAudioData() { + String audioJson = "{" + + "\"kind\": \"AudioData\"," + + "\"audioData\": {" + + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," + + "\"participantRawID\": \"participantId\"," + + "\"data\": \"AQIDBAU=\"," + + "\"silent\": false" + + "}" + + "}"; + AudioData audioData = (AudioData) StreamingDataParser.parse(audioJson); + assertNotNull(audioData); + checkAudioData(audioData); + } + + @Test + public void parseAudioDataNoParticipantNoSilent() { + String audioJson = "{" + + "\"kind\": \"AudioData\"," + + "\"audioData\": {" + + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," + + "\"data\": \"AQIDBAU=\"" + + "}" + + "}"; + AudioData audioData = (AudioData) StreamingDataParser.parse(audioJson); + assertNotNull(audioData); + checkAudioDataNoParticipant(audioData); + } + + @Test + public void parseAudioMetadata() { + String metadataJson = "{" + + " \"kind\": \"AudioMetadata\"," + + "\"audioMetadata\": {" + + "\"subscriptionId\": \"subscriptionId\"," + + "\"encoding\": \"PCM\"," + + "\"sampleRate\": 8," + + "\"channels\": 2," + + "\"length\": 100" + + "}" + + "}"; + AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(metadataJson); + assertNotNull(audioMetadata); + checkAudioMetadata(audioMetadata); + } + + @Test + public void parseBinaryAudioData() { + String jsonData = createAudioDataJson(); + AudioData audioData = (AudioData) StreamingDataParser.parse(BinaryData.fromString(jsonData)); + checkAudioData(audioData); + } + + @Test + public void parseBinaryAudioMetadata() { + String jsonMetadata = createAudioMetadataJson(); + AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(BinaryData.fromString(jsonMetadata)); + checkAudioMetadata(audioMetadata); + } + + @Test + public void parseBinaryArrayAudioData() { + String jsonData = createAudioDataJson(); + AudioData audioData = (AudioData) StreamingDataParser.parse(jsonData.getBytes(StandardCharsets.UTF_8)); + checkAudioData(audioData); + } + + @Test + public void parseBinaryArrayAudioMetadata() { + String jsonMetadata = createAudioMetadataJson(); + AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(jsonMetadata.getBytes(StandardCharsets.UTF_8)); + checkAudioMetadata(audioMetadata); + } + + private void checkAudioData(AudioData mediaStreamingAudio) { + assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); + assertEquals("participantId", mediaStreamingAudio.getParticipant().getRawId()); + assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); + assertFalse(mediaStreamingAudio.isSilent()); + } + + private void checkAudioDataNoParticipant(AudioData mediaStreamingAudio) { + assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); + assertNull(mediaStreamingAudio.getParticipant()); + assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); + assertFalse(mediaStreamingAudio.isSilent()); + } + + private void checkAudioMetadata(AudioMetadata audioMetadata) { + assertEquals("subscriptionId", audioMetadata.getMediaSubscriptionId()); + assertEquals("PCM", audioMetadata.getEncoding()); + assertEquals(8, audioMetadata.getSampleRate()); + assertEquals(2, audioMetadata.getChannels()); + assertEquals(100, audioMetadata.getLength()); + } + + private String createAudioMetadataJson() { + try { + ObjectMapper objectMapper = new ObjectMapper(); + ObjectNode audioMetadata = objectMapper.createObjectNode(); + audioMetadata.put("kind", "AudioMetadata"); + audioMetadata.put("subscriptionId", "subscriptionId"); + audioMetadata.put("encoding", "PCM"); + audioMetadata.put("sampleRate", 8); + audioMetadata.put("channels", 2); + audioMetadata.put("length", 100); + ObjectNode root = objectMapper.createObjectNode(); + root.put("kind", "AudioMetadata"); + root.set("audioMetadata", audioMetadata); + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); + } catch (Exception e) { + throw new RuntimeException(); + } + } + + private String createAudioDataJson() { + try { + ObjectMapper objectMapper = new ObjectMapper(); + ObjectNode audioData = objectMapper.createObjectNode(); + audioData.put("kind", "AudioData"); + audioData.put("timestamp", "2022-10-03T19:16:12.925Z"); + audioData.put("participantRawID", "participantId"); + audioData.put("data", "AQIDBAU="); + audioData.put("silent", false); + ObjectNode root = objectMapper.createObjectNode(); + root.put("kind", "AudioData"); + root.set("audioData", audioData); + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); + } catch (Exception e) { + throw new RuntimeException(); + } + } + //endregion + + // region Transcription + @Test + public void parseTranscriptionData() { + String transcriptionJson = + "{" + + "\"kind\":\"TranscriptionData\"," + + "\"transcriptionData\":" + + "{" + + "\"text\":\"Hello World!\"," + + "\"format\":\"display\"," + + "\"confidence\":0.98," + + "\"offset\":1," + + "\"words\":" + + "[" + + "{" + + "\"text\":\"Hello\"," + + "\"offset\":1" + + "}," + + "{" + + "\"text\":\"World\"," + + "\"offset\":6" + + "}" + + "]," + + "\"participantRawID\":\"abc12345\"," + + "\"resultStatus\":\"final\"" + + "}" + + "}"; + TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(transcriptionJson); + assertNotNull(transcriptionData); + validateTranscriptionData(transcriptionData); + } + + @Test + public void parseTranscriptionMetadata() { + String transcriptionMetadataJson = + "{" + + "\"kind\":\"TranscriptionMetadata\"," + + "\"transcriptionMetadata\":" + + "{" + + "\"subscriptionId\":\"subscriptionId\"," + + "\"locale\":\"en-US\"," + + "\"callConnectionId\":\"callConnectionId\"," + + "\"correlationId\":\"correlationId\"" + + "}" + + "}"; + TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(transcriptionMetadataJson); + assertNotNull(transcriptionMetadata); + validateTranscriptionMetadata(transcriptionMetadata); + } + + @Test + public void parseBinaryTranscriptionData() { + String jsonData = createTranscriptionDataJson(); + TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(BinaryData.fromString(jsonData)); + validateTranscriptionData(transcriptionData); + } + + @Test + public void parseBinaryTranscriptionMetadata() { + String jsonMetadata = createTranscriptionMetadataJson(); + TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(BinaryData.fromString(jsonMetadata)); + validateTranscriptionMetadata(transcriptionMetadata); + } + + @Test + public void parseBinaryArrayTranscriptionData() { + String jsonData = createTranscriptionDataJson(); + TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(jsonData.getBytes(StandardCharsets.UTF_8)); + validateTranscriptionData(transcriptionData); + } + + @Test + public void parseBinaryArrayTranscriptionMetadata() { + String jsonMetadata = createTranscriptionMetadataJson(); + TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(jsonMetadata.getBytes(StandardCharsets.UTF_8)); + validateTranscriptionMetadata(transcriptionMetadata); + } + + private void validateTranscriptionData(TranscriptionData transcription) { + assertNotNull(transcription); + assertEquals("Hello World!", transcription.getText()); + assertEquals(TextFormat.DISPLAY, transcription.getFormat()); + assertEquals(0.98d, transcription.getConfidence()); + assertEquals(1, transcription.getOffset()); + + // validate individual words + List words = transcription.getWords(); + assertEquals(2, words.size()); + assertEquals("Hello", words.get(0).getText()); + assertEquals(1, words.get(0).getOffset()); + assertEquals("World", words.get(1).getText()); + assertEquals(6, words.get(1).getOffset()); + + assertNotNull(transcription.getParticipant()); + assertEquals("abc12345", transcription.getParticipant().getRawId()); + System.out.println(transcription.getResultStatus().toString()); + assertEquals(ResultStatus.FINAL, transcription.getResultStatus()); + } + + private static void validateTranscriptionMetadata(TranscriptionMetadata transcriptionMetadata) { + assertNotNull(transcriptionMetadata); + assertEquals("subscriptionId", transcriptionMetadata.getTranscriptionSubscriptionId()); + assertEquals("en-US", transcriptionMetadata.getLocale()); + assertEquals("callConnectionId", transcriptionMetadata.getCallConnectionId()); + assertEquals("correlationId", transcriptionMetadata.getCorrelationId()); + } + + + private String createTranscriptionMetadataJson() { + try { + ObjectMapper objectMapper = new ObjectMapper(); + ObjectNode jsonData = objectMapper.createObjectNode(); + jsonData.put("kind", "TranscriptionMetadata"); + ObjectNode transcriptionMetaData = objectMapper.createObjectNode(); + jsonData.set("transcriptionMetadata", transcriptionMetaData); + transcriptionMetaData.put("subscriptionId", "subscriptionId"); + transcriptionMetaData.put("locale", "en-US"); + transcriptionMetaData.put("callConnectionId", "callConnectionId"); + transcriptionMetaData.put("correlationId", "correlationId"); + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonData); + } catch (Exception e) { + throw new RuntimeException(); + } + } + + private String createTranscriptionDataJson() { + try { + ObjectMapper objectMapper = new ObjectMapper(); + ObjectNode jsonData = objectMapper.createObjectNode(); + jsonData.put("kind", "TranscriptionData"); + ObjectNode transcriptionData = objectMapper.createObjectNode(); + jsonData.set("transcriptionData", transcriptionData); + transcriptionData.put("text", "Hello World!"); + transcriptionData.put("format", "Display"); + transcriptionData.put("confidence", 0.98d); + transcriptionData.put("offset", 1); + + ArrayNode words = objectMapper.createArrayNode(); + transcriptionData.set("words", words); + + ObjectNode word0 = objectMapper.createObjectNode(); + word0.put("text", "Hello"); + word0.put("offset", 1); + words.add(word0); + + ObjectNode word1 = objectMapper.createObjectNode(); + word1.put("text", "World"); + word1.put("offset", 6); + words.add(word1); + + transcriptionData.put("participantRawID", "abc12345"); + transcriptionData.put("resultStatus", "final"); + + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonData); + } catch (Exception e) { + throw new RuntimeException(); + } + } + //endregion +} diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index 39fb90dc2b91c..093d654e906e3 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -21,7 +21,7 @@ There is one swagger for Calling management APIs. ```ps cd -autorest README.md --java --v4 --use=@autorest/java@4.1.23 +autorest README.md --java --v4 --use=@autorest/java@4.0.20 --use=@autorest/modelerfour@4.15.442 ``` ### Code generation settings @@ -196,6 +196,18 @@ directive: - rename-model: from: ContinuousDtmfRecognitionRequest to: ContinuousDtmfRecognitionRequestInternal +- rename-model: + from: TranscriptionConfiguration + to: TranscriptionConfigurationInternal +- rename-model: + from: StartTranscriptionRequest + to: StartTranscriptionRequestInternal +- rename-model: + from: StopTranscriptionRequest + to: StopTranscriptionRequestInternal +- rename-model: + from: UpdateTranscriptionRequest + to: UpdateTranscriptionRequestInternal - rename-model: from: StartDialogRequest to: StartDialogRequestInternal @@ -235,6 +247,13 @@ directive: - remove-model: DialogStarted - remove-model: DialogTransfer - remove-model: DialogFailed +- remove-model: TranscriptionStarted +- remove-model: TranscriptionResumed +- remove-model: TranscriptionStopped +- remove-model: TranscriptionUpdated +- remove-model: TranscriptionFailed + + ``` ### Rename RecordingChannelType to RecordingChannelInternal @@ -355,7 +374,7 @@ directive: $.name = "MediaStreamingContentTypeInternal"; ``` -### Rename MediaStreamingTransportType to MediaStreamingTransportType +### Rename MediaStreamingTransportType to MediaStreamingTransportTypeInternal ``` yaml directive: - from: swagger-document @@ -364,6 +383,15 @@ directive: $.name = "MediaStreamingTransportTypeInternal"; ``` +### Rename TranscriptionTransportType to TranscriptionTransportTypeInternal +``` yaml +directive: +- from: swagger-document + where: $.definitions.TranscriptionTransportType["x-ms-enum"] + transform: > + $.name = "TranscriptionTransportTypeInternal"; +``` + ### Rename RecognitionType to RecognitionTypeInternal ``` yaml directive: