From 93f2fb12dc8d783321b378e948f350c9e21648ae Mon Sep 17 00:00:00 2001 From: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Date: Fri, 1 Dec 2023 09:59:23 -0800 Subject: [PATCH] [ACS][CallAutomation] Updating SDK alpha version to 1.2, and various important updates (#37569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding initial latest alpha changes * Changes to include remove async postfix and removing toneinfo (unused) * Updating with latest GA2 changes * Updating versions * Lint update * Added missing end of file new line * reorder version list properly * Updating Swagger version to latest 4.1.23 --------- Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 28 +- .../README.md | 30 +- .../pom.xml | 2 +- .../CallAutomationAsyncClient.java | 130 +- .../CallAutomationEventParser.java | 18 +- .../CallAutomationServiceVersion.java | 12 +- .../callautomation/CallConnection.java | 65 +- .../callautomation/CallConnectionAsync.java | 131 +- .../callautomation/CallDialogAsync.java | 23 +- .../callautomation/CallMedia.java | 43 +- .../callautomation/CallMediaAsync.java | 290 +-- .../callautomation/CallRecordingAsync.java | 4 - ...ommunicationCallAutomationServiceImpl.java | 783 ++----- ...ationCallAutomationServiceImplBuilder.java | 293 ++- .../implementation/CallConnectionsImpl.java | 1951 +++++------------ .../implementation/CallDialogsImpl.java | 222 +- .../implementation/CallMediasImpl.java | 1023 ++++----- .../implementation/CallRecordingsImpl.java | 452 ++-- .../implementation/Constants.java | 2 +- ...ddParticipantResponseConstructorProxy.java | 24 +- ...eParticipantsResponseConstructorProxy.java | 26 +- ...SendDtmfTonesResponseConstructorProxy.java | 59 + ...eParticipantsResponseConstructorProxy.java | 24 +- .../models/AddParticipantCancelled.java | 175 -- .../models/AddParticipantRequestInternal.java | 130 +- .../AddParticipantResponseInternal.java | 22 +- .../models/AnswerCallRequestInternal.java | 91 +- .../models/AzureOpenAIDialog.java | 33 + .../implementation/models/BaseDialog.java | 58 + .../models/BlobStorageInternal.java | 14 +- .../CallConnectionPropertiesInternal.java | 123 +- .../CallConnectionStateModelInternal.java | 49 +- .../models/CallIntelligenceOptions.java | 43 + .../CallIntelligenceOptionsInternal.java | 48 + .../models/CallLocatorInternal.java | 22 +- .../models/CallLocatorKindInternal.java | 29 +- .../models/CallParticipantInternal.java | 18 +- .../models/CallRejectReasonInternal.java | 33 +- .../models/CancelAddParticipantFailed.java | 175 -- .../models/CancelAddParticipantRequest.java | 55 +- .../models/CancelAddParticipantResponse.java | 18 +- .../models/ChannelAffinityInternal.java | 24 +- .../models/ChoiceResultInternal.java | 34 +- .../models/CollectTonesResultInternal.java | 12 +- .../CommunicationCloudEnvironmentModel.java | 33 +- .../models/CommunicationError.java | 24 +- .../models/CommunicationErrorResponse.java | 14 +- .../CommunicationErrorResponseException.java | 15 +- .../models/CommunicationIdentifierModel.java | 26 +- .../CommunicationIdentifierModelKind.java | 37 +- .../CommunicationUserIdentifierModel.java | 14 +- .../ContinuousDtmfRecognitionRequest.java | 64 - ...tinuousDtmfRecognitionRequestInternal.java | 56 +- .../models/CreateCallRequestInternal.java | 138 +- .../models/CustomCallingContext.java | 73 + .../implementation/models/CustomContext.java | 3 + .../models/DialogInputType.java | 29 +- .../implementation/models/DialogOptions.java | 65 - .../models/DialogStateResponse.java | 70 +- .../models/DtmfOptionsInternal.java | 22 +- .../implementation/models/DtmfResult.java | 12 +- .../models/DtmfToneInternal.java | 85 +- .../models/ExternalStorageInternal.java | 18 +- .../models/FileSourceInternal.java | 14 +- .../models/GenderTypeInternal.java | 34 - .../GetParticipantsResponseInternal.java | 38 +- .../implementation/models/Hangup.java | 38 - .../HoldParticipantRequestInternal.java | 119 - ...ediaStreamingAudioChannelTypeInternal.java | 31 +- .../MediaStreamingConfigurationInternal.java | 30 +- .../MediaStreamingContentTypeInternal.java | 25 +- .../MediaStreamingTransportTypeInternal.java | 27 +- .../MicrosoftTeamsUserIdentifierModel.java | 31 +- .../MuteParticipantsRequestInternal.java | 31 +- .../MuteParticipantsResponseInternal.java | 38 - ...va => MuteParticipantsResultInternal.java} | 20 +- .../models/PhoneNumberIdentifierModel.java | 14 +- .../models/PlayOptionsInternal.java | 14 +- .../implementation/models/PlayRequest.java | 88 +- .../models/PlaySourceInternal.java | 133 +- .../models/PlaySourceTypeInternal.java | 33 +- .../models/PowerVirtualAgentsDialog.java | 86 + ...al.java => RecognitionChoiceInternal.java} | 36 +- .../models/RecognitionTypeInternal.java | 34 +- .../models/RecognizeInputTypeInternal.java | 37 +- .../models/RecognizeOptionsInternal.java | 48 +- .../models/RecognizeRequest.java | 69 +- .../models/RecordingChannelInternal.java | 29 +- .../models/RecordingContentInternal.java | 29 +- .../models/RecordingFormatInternal.java | 33 +- .../models/RecordingStateInternal.java | 29 +- .../RecordingStateResponseInternal.java | 22 +- .../models/RecordingStorageTypeInternal.java | 29 +- .../implementation/models/RecordingType.java | 29 +- .../models/RedirectCallRequestInternal.java | 44 +- .../models/RejectCallRequestInternal.java | 18 +- .../models/RemoveParticipantFailed.java | 164 +- .../RemoveParticipantRequestInternal.java | 55 +- .../RemoveParticipantResponseInternal.java | 14 +- .../models/RemoveParticipantSucceeded.java | 164 +- .../models/ResultInformation.java | 30 +- .../models/SendDtmfOptionsInternal.java | 65 - .../models/SendDtmfRequest.java | 91 - ...java => SendDtmfTonesRequestInternal.java} | 78 +- ....java => SendDtmfTonesResultInternal.java} | 20 +- .../implementation/models/SensitiveFlag.java | 38 - .../implementation/models/SpeechOptions.java | 43 - .../models/SpeechOptionsInternal.java | 17 +- .../implementation/models/SpeechResult.java | 41 - .../models/SpeechResultInternal.java | 14 +- .../implementation/models/SsmlSource.java | 41 - .../models/SsmlSourceInternal.java | 18 +- .../StartCallRecordingRequestInternal.java | 104 +- .../models/StartDialogRequest.java | 93 - .../models/StartDialogRequestInternal.java | 74 +- .../models/StartHoldMusicRequestInternal.java | 29 +- .../models/StartTranscriptionRequest.java | 18 +- .../models/StopHoldMusicRequestInternal.java | 27 +- .../models/StopTranscriptionRequest.java | 14 +- .../models/TextSourceInternal.java | 64 +- .../models/TranscriptionConfiguration.java | 29 +- .../models/TranscriptionFailed.java | 134 +- .../models/TranscriptionResumed.java | 134 +- .../models/TranscriptionStarted.java | 134 +- .../models/TranscriptionStatus.java | 47 +- .../models/TranscriptionStatusDetails.java | 104 +- .../models/TranscriptionStopped.java | 134 +- .../models/TranscriptionTransportType.java | 25 +- .../models/TranscriptionUpdate.java | 18 +- .../models/TranscriptionUpdated.java | 113 + .../models/TransferCallResponseInternal.java | 14 +- .../models/TransferToExternalNumber.java | 64 - .../TransferToParticipantRequestInternal.java | 91 +- .../UnholdParticipantRequestInternal.java | 68 - .../UnmuteParticipantsRequestInternal.java | 31 +- .../UnmuteParticipantsResponseInternal.java | 14 +- .../UpdateTranscriptionDataRequest.java | 3 + .../models/UpdateTranscriptionRequest.java | 46 + .../implementation/models/UserConsent.java | 14 +- .../models/VoiceKindInternal.java | 53 + .../implementation/models/package-info.java | 4 +- .../implementation/package-info.java | 4 +- .../models/AddParticipantOptions.java | 21 +- .../models/AnswerCallOptions.java | 68 +- .../models/CallConnectionProperties.java | 35 +- .../models/CallIntelligenceOptions.java | 42 + .../callautomation/models/CallInvite.java | 34 +- .../CallMediaRecognizeChoiceOptions.java | 48 +- .../models/CallMediaRecognizeOptions.java | 65 +- .../CallMediaRecognizeSpeechOptions.java | 75 +- ...CallMediaRecognizeSpeechOrDtmfOptions.java | 80 +- .../CancelAddParticipantEventResult.java | 20 +- ...CancelAddParticipantOperationOptions.java} | 28 +- ... CancelAddParticipantOperationResult.java} | 22 +- .../models/CollectTonesResult.java | 55 - .../ContinuousDtmfRecognitionOptions.java | 87 + .../models/CreateCallOptions.java | 93 +- .../models/CreateGroupCallOptions.java | 125 +- .../models/CustomCallingContext.java | 97 + .../callautomation/models/CustomContext.java | 81 - .../models/CustomContextHeader.java | 43 - .../callautomation/models/GenderType.java | 37 - ...tions.java => MuteParticipantOptions.java} | 19 +- ...Result.java => MuteParticipantResult.java} | 14 +- .../callautomation/models/PlayOptions.java | 56 +- .../callautomation/models/PlaySource.java | 29 +- .../models/PlayToAllOptions.java | 49 +- ...nizeChoice.java => RecognitionChoice.java} | 20 +- .../models/RemoveParticipantOptions.java | 22 +- .../models/SIPCustomHeader.java | 23 - .../callautomation/models/SIPUUIHeader.java | 23 - .../models/SendDtmfTonesOptions.java | 104 + .../models/SendDtmfTonesResult.java | 58 + .../callautomation/models/SpeechResult.java | 20 +- .../callautomation/models/TextSource.java | 24 +- .../callautomation/models/ToneInfo.java | 66 - .../TransferCallToParticipantOptions.java | 54 +- ...ons.java => UnmuteParticipantOptions.java} | 19 +- ...sult.java => UnmuteParticipantResult.java} | 8 +- .../callautomation/models/VoiceKind.java | 38 + .../callautomation/models/VoipHeader.java | 23 - .../events/AddParticipantCancelled.java | 61 - .../models/events/CallTransferAccepted.java | 20 +- .../events/CancelAddParticipantSucceeded.java | 34 + ...ContinuousDtmfRecognitionToneReceived.java | 36 +- .../models/events/ReasonCode.java | 19 +- ...leted.java => SendDtmfTonesCompleted.java} | 8 +- ...mfFailed.java => SendDtmfTonesFailed.java} | 8 +- .../callautomation/models/package-info.java | 4 +- ...tomationAsyncClientAutomatedLiveTests.java | 4 + ...ationEventParserAndProcessorUnitTests.java | 110 +- .../CallAutomationUnitTestBase.java | 6 +- ...CallConnectionAsyncAutomatedLiveTests.java | 19 +- .../CallConnectionAsyncUnitTests.java | 117 +- .../CallConnectionUnitTests.java | 71 +- .../CallDialogAsyncAutomatedLiveTests.java | 5 +- .../CallMediaAsyncAutomatedLiveTests.java | 11 +- .../CallMediaAsyncUnitTests.java | 59 +- .../callautomation/CallMediaUnitTests.java | 53 +- .../CallRecordingAutomatedLiveTests.java | 5 + .../swagger/README.md | 54 +- 202 files changed, 6594 insertions(+), 7500 deletions(-) create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/SendDtmfTonesResponseConstructorProxy.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantCancelled.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogOptions.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GenderTypeInternal.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/Hangup.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantRequestInternal.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/{UnholdParticipantResponseInternal.java => MuteParticipantsResultInternal.java} (69%) create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/{RecognizeChoiceInternal.java => RecognitionChoiceInternal.java} (73%) delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfOptionsInternal.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequest.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/{SendDtmfRequestInternal.java => SendDtmfTonesRequestInternal.java} (50%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/{HoldParticipantResponseInternal.java => SendDtmfTonesResultInternal.java} (70%) delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SensitiveFlag.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSource.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartDialogRequest.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdated.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToExternalNumber.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantRequestInternal.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallIntelligenceOptions.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{CancelAddParticipantOptions.java => CancelAddParticipantOperationOptions.java} (54%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{CancelAddParticipantResult.java => CancelAddParticipantOperationResult.java} (75%) delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CollectTonesResult.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ContinuousDtmfRecognitionOptions.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContext.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContextHeader.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/GenderType.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{MuteParticipantsOptions.java => MuteParticipantOptions.java} (66%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{MuteParticipantsResult.java => MuteParticipantResult.java} (77%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{RecognizeChoice.java => RecognitionChoice.java} (78%) delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPCustomHeader.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPUUIHeader.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesOptions.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesResult.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ToneInfo.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{UnmuteParticipantsOptions.java => UnmuteParticipantOptions.java} (66%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/{UnmuteParticipantsResult.java => UnmuteParticipantResult.java} (86%) create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoiceKind.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoipHeader.java delete mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AddParticipantCancelled.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CancelAddParticipantSucceeded.java rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/{SendDtmfCompleted.java => SendDtmfTonesCompleted.java} (79%) rename sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/{SendDtmfFailed.java => SendDtmfTonesFailed.java} (80%) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index dea947fd93d01..65352a7cca671 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -65,7 +65,7 @@ com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-aot-graalvm-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-code-customization-parent;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-communication-callautomation;1.0.6;1.1.0-beta.1 +com.azure:azure-communication-callautomation;1.1.0;1.2.0-beta.1 com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-communication-chat;1.3.14;1.4.0-beta.1 com.azure:azure-communication-common;1.2.14;2.0.0-beta.2 diff --git a/sdk/communication/azure-communication-callautomation/CHANGELOG.md b/sdk/communication/azure-communication-callautomation/CHANGELOG.md index 698d95eca91bc..79693fd252871 100644 --- a/sdk/communication/azure-communication-callautomation/CHANGELOG.md +++ b/sdk/communication/azure-communication-callautomation/CHANGELOG.md @@ -1,11 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (Unreleased) ### Features Added -- Start/Stop continuous DTMF recognition by subscribing/unsubscribing to tones. -- Send DTMF tones to a participant in the call -- StartRecording now accepts PauseOnStart. ### Breaking Changes @@ -13,6 +10,29 @@ ### Other Changes +## 1.1.0 (2023-11-23) + +### Features Added + +- Mid-Call actions support overriding callback uri +- Cancel adding Participant invitation +- Support transfer a participant in a group call to another participant +- Add Custom Context payload to Transfer and AddParticipant API + +### Other Changes + +- Dependency versions updated. + +## 1.1.0-beta.1 (2023-08-17) + +### Features Added + +- Play and recognize supports TTS and SSML source prompts. +- Recognize supports choices and freeform speech. +- Start/Stop continuous DTMF recognition by subscribing/unsubscribing to tones. +- Send DTMF tones to a participant in the call. +- Mute participants in the call. + ## 1.0.6 (2023-11-20) ### Other Changes diff --git a/sdk/communication/azure-communication-callautomation/README.md b/sdk/communication/azure-communication-callautomation/README.md index ffa0b4b23b3cc..423261a656736 100644 --- a/sdk/communication/azure-communication-callautomation/README.md +++ b/sdk/communication/azure-communication-callautomation/README.md @@ -21,7 +21,7 @@ This package contains a Java SDK for Azure Communication Call Automation Service com.azure azure-communication-callautomation - 1.0.2 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -37,7 +37,7 @@ This is the restart of Call Automation Service. It is renamed to Call Automation `CallRecording` provides the functionality of recording the call. -`EventHandler` provides the functionality to handle events from the ACS resource. +`CallAutomationEventParser` provides the functionality to handle events from the ACS resource. ## Examples @@ -48,7 +48,7 @@ Take a look at `CallAutomationEventProcessor`. This will ensure correlation betw @RestController public class ActionController { // Controller implementation... - + @RequestMapping(value = "/api/events", method = POST) public ResponseEntity handleCallEvents(@RequestBody String requestBody) { try { @@ -108,9 +108,15 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m ## Next steps -- [Read more about Call Automation in Azure Communication Services][call_automation_apis_overview] -- [Read more about Call Recording in Azure Communication Services][call_recording_overview] -- For a basic guide on how to record and download calls with Event Grid please refer to the [Record and download calls with Event Grid][record_and_download_calls_with_event_grid]. +- [Call Automation Overview][overview] +- [Incoming Call Concept][incomingcall] +- [Build a customer interaction workflow using Call Automation][build1] +- [Redirect inbound telephony calls with Call Automation][build2] +- [Connect Azure Communication Services with Azure AI services][cognitive_integration] +- [Quickstart: Play action][build3] +- [Quickstart: Recognize action][build4] +- [Read more about Call Recording in Azure Communication Services][recording1] +- [Record and download calls with Event Grid][recording2] [cla]: https://cla.microsoft.com @@ -120,7 +126,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [product_docs]: https://docs.microsoft.com/azure/communication-services/ [package]: https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-java-communication-interaction [api_documentation]: https://aka.ms/java-docs -[call_automation_apis_overview]:https://docs.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation-apis -[call_recording_overview]:https://docs.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording -[record_and_download_calls_with_event_grid]:https://docs.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/download-recording-file-sample [source]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/communication/azure-communication-callautomation/src +[overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation +[incomingcall]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/incoming-call-notification +[build1]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-java +[build2]: https://learn.microsoft.com/azure/communication-services/how-tos/call-automation-sdk/redirect-inbound-telephony-calls?pivots=programming-language-java +[build3]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/play-action?pivots=programming-language-java +[build4]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/recognize-action?pivots=programming-language-java +[recording1]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording +[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-java +[cognitive_integration]: https://learn.microsoft.com/azure/communication-services/concepts/call-automation/azure-communication-services-azure-cognitive-services-integration \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/pom.xml b/sdk/communication/azure-communication-callautomation/pom.xml index da2d823f5a537..f277cb3d8734f 100644 --- a/sdk/communication/azure-communication-callautomation/pom.xml +++ b/sdk/communication/azure-communication-callautomation/pom.xml @@ -15,7 +15,7 @@ com.azure azure-communication-callautomation jar - 1.1.0-beta.1 + 1.2.0-beta.1 Microsoft Azure client library for Call Automation service 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 f4397148c1fa2..9d6a537a478da 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 @@ -12,24 +12,25 @@ import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; import com.azure.communication.callautomation.implementation.converters.CommunicationUserIdentifierConverter; import com.azure.communication.callautomation.implementation.converters.PhoneNumberIdentifierConverter; +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.models.AnswerCallOptions; -import com.azure.communication.callautomation.models.AnswerCallResult; -import com.azure.communication.callautomation.models.CallInvite; -import com.azure.communication.callautomation.models.CreateCallOptions; 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.CustomContext; -import com.azure.communication.callautomation.implementation.models.AnswerCallRequestInternal; +import com.azure.communication.callautomation.implementation.models.CustomCallingContext; import com.azure.communication.callautomation.implementation.models.RedirectCallRequestInternal; import com.azure.communication.callautomation.implementation.models.RejectCallRequestInternal; -import com.azure.communication.callautomation.implementation.models.CallRejectReasonInternal; -import com.azure.communication.callautomation.models.CreateGroupCallOptions; +import com.azure.communication.callautomation.models.AnswerCallOptions; +import com.azure.communication.callautomation.models.AnswerCallResult; +import com.azure.communication.callautomation.models.CallInvite; +import com.azure.communication.callautomation.models.CreateCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; +import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.MediaStreamingOptions; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; @@ -38,20 +39,18 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.core.exception.HttpResponseException; 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; @@ -170,46 +169,26 @@ public Mono> createGroupCallWithResponse(CreateGroupC } Mono> createCallWithResponseInternal(CreateCallOptions createCallOptions, Context context) { - try { - context = context == null ? Context.NONE : context; - CreateCallRequestInternal request = getCreateCallRequestInternal(createCallOptions); - return azureCommunicationCallAutomationServiceInternal.createCallWithResponseAsync( - request, - UUID.randomUUID(), - OffsetDateTime.now(), - context) - .map(response -> { - try { - CallConnectionAsync callConnectionAsync = getCallConnectionAsync(response.getValue().getCallConnectionId()); - CreateCallResult result = new CreateCallResult(CallConnectionPropertiesConstructorProxy.create(response.getValue()), - new CallConnection(callConnectionAsync), callConnectionAsync); - result.setEventProcessor(eventProcessor, response.getValue().getCallConnectionId(), null); - return new SimpleResponse<>(response, result); - } catch (URISyntaxException e) { - throw logger.logExceptionAsError(new RuntimeException(e)); - } - }); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } + return getCreateCallResponseMono(context, getCreateCallRequestInternal(createCallOptions)); } Mono> createGroupCallWithResponseInternal(CreateGroupCallOptions createGroupCallOptions, Context context) { + return getCreateCallResponseMono(context, getCreateCallRequestInternal(createGroupCallOptions)); + } + + private Mono> getCreateCallResponseMono(Context context, CreateCallRequestInternal createCallRequestInternal) { try { context = context == null ? Context.NONE : context; - CreateCallRequestInternal request = getCreateCallRequestInternal(createGroupCallOptions); return azureCommunicationCallAutomationServiceInternal.createCallWithResponseAsync( - request, - UUID.randomUUID(), - OffsetDateTime.now(), + createCallRequestInternal, context) .map(response -> { try { CallConnectionAsync callConnectionAsync = getCallConnectionAsync(response.getValue().getCallConnectionId()); - CreateCallResult result = new CreateCallResult(CallConnectionPropertiesConstructorProxy.create(response.getValue()), - new CallConnection(callConnectionAsync), callConnectionAsync); - result.setEventProcessor(eventProcessor, response.getValue().getCallConnectionId(), null); - return new SimpleResponse<>(response, result); + + return new SimpleResponse<>(response, + new CreateCallResult(CallConnectionPropertiesConstructorProxy.create(response.getValue()), + new CallConnection(callConnectionAsync), callConnectionAsync)); } catch (URISyntaxException e) { throw logger.logExceptionAsError(new RuntimeException(e)); } @@ -223,20 +202,27 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions List targetsModel = new LinkedList(); targetsModel.add(CommunicationIdentifierConverter.convert(createCallOptions.getCallInvite().getTargetParticipant())); + CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = null; + if (createCallOptions.getCallIntelligenceOptions() != null && createCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint() != null) { + callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal(); + callIntelligenceOptionsInternal.setCognitiveServicesEndpoint(createCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint()); + } + CreateCallRequestInternal request = new CreateCallRequestInternal() .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(createCallOptions.getCallInvite().getSourceCallerIdNumber())) .setSourceDisplayName(createCallOptions.getCallInvite().getSourceDisplayName()) - .setSourceIdentity(sourceIdentity) + .setSource(sourceIdentity) .setTargets(targetsModel) .setCallbackUri(createCallOptions.getCallbackUrl()) + .setCallIntelligenceOptions(callIntelligenceOptionsInternal) .setOperationContext(createCallOptions.getOperationContext()); // Need to do a null check since SipHeaders and VoipHeaders are optional; If they both are null then we do not need to set custom context - if (createCallOptions.getCallInvite().getCustomContext().getSipHeaders() != null || createCallOptions.getCallInvite().getCustomContext().getVoipHeaders() != null) { - CustomContext customContext = new CustomContext(); - customContext.setSipHeaders(createCallOptions.getCallInvite().getCustomContext().getSipHeaders()); - customContext.setVoipHeaders(createCallOptions.getCallInvite().getCustomContext().getVoipHeaders()); - request.setCustomContext(customContext); + if (createCallOptions.getCallInvite().getCustomCallingContext().getSipHeaders() != null || createCallOptions.getCallInvite().getCustomCallingContext().getVoipHeaders() != null) { + CustomCallingContext customContext = new CustomCallingContext(); + customContext.setSipHeaders(createCallOptions.getCallInvite().getCustomCallingContext().getSipHeaders()); + customContext.setVoipHeaders(createCallOptions.getCallInvite().getCustomCallingContext().getVoipHeaders()); + request.setCustomCallingContext(customContext); } if (createCallOptions.getMediaStreamingConfiguration() != null) { @@ -245,10 +231,6 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions request.setMediaStreamingConfiguration(streamingConfigurationInternal); } - if (createCallOptions.getAzureCognitiveServicesUrl() != null && !createCallOptions.getAzureCognitiveServicesUrl().isEmpty()) { - request.setAzureCognitiveServicesEndpointUrl(createCallOptions.getAzureCognitiveServicesUrl()); - } - return request; } @@ -256,19 +238,26 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp List targetsModel = createCallGroupOptions.getTargetParticipants() .stream().map(CommunicationIdentifierConverter::convert).collect(Collectors.toList()); + CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = null; + if (createCallGroupOptions.getCallIntelligenceOptions() != null && createCallGroupOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint() != null) { + callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal(); + callIntelligenceOptionsInternal.setCognitiveServicesEndpoint(createCallGroupOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint()); + } + CreateCallRequestInternal request = new CreateCallRequestInternal() .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(createCallGroupOptions.getSourceCallIdNumber())) .setSourceDisplayName(createCallGroupOptions.getSourceDisplayName()) - .setSourceIdentity(sourceIdentity) + .setSource(sourceIdentity) .setTargets(targetsModel) .setCallbackUri(createCallGroupOptions.getCallbackUrl()) + .setCallIntelligenceOptions(callIntelligenceOptionsInternal) .setOperationContext(createCallGroupOptions.getOperationContext()); if (createCallGroupOptions.getCustomContext().getSipHeaders() != null || createCallGroupOptions.getCustomContext().getVoipHeaders() != null) { - CustomContext customContext = new CustomContext(); + CustomCallingContext customContext = new CustomCallingContext(); customContext.setSipHeaders(createCallGroupOptions.getCustomContext().getSipHeaders()); customContext.setVoipHeaders(createCallGroupOptions.getCustomContext().getVoipHeaders()); - request.setCustomContext(customContext); + request.setCustomCallingContext(customContext); } if (createCallGroupOptions.getMediaStreamingConfiguration() != null) { @@ -277,10 +266,6 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp request.setMediaStreamingConfiguration(streamingConfigurationInternal); } - if (createCallGroupOptions.getAzureCognitiveServicesUrl() != null && !createCallGroupOptions.getAzureCognitiveServicesUrl().isEmpty()) { - request.setAzureCognitiveServicesEndpointUrl(createCallGroupOptions.getAzureCognitiveServicesUrl()); - } - return request; } @@ -335,24 +320,23 @@ Mono> answerCallWithResponseInternal(AnswerCallOption AnswerCallRequestInternal request = new AnswerCallRequestInternal() .setIncomingCallContext(answerCallOptions.getIncomingCallContext()) .setCallbackUri(answerCallOptions.getCallbackUrl()) - .setAnsweredByIdentifier(sourceIdentity) + .setAnsweredBy(sourceIdentity) .setOperationContext(answerCallOptions.getOperationContext()); + if (answerCallOptions.getCallIntelligenceOptions() != null && answerCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint() != null) { + CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal(); + callIntelligenceOptionsInternal.setCognitiveServicesEndpoint(answerCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint()); + request.setCallIntelligenceOptions(callIntelligenceOptionsInternal); + } + if (answerCallOptions.getMediaStreamingConfiguration() != null) { MediaStreamingConfigurationInternal mediaStreamingConfigurationInternal = getMediaStreamingConfigurationInternal(answerCallOptions.getMediaStreamingConfiguration()); request.setMediaStreamingConfiguration(mediaStreamingConfigurationInternal); } - - if (answerCallOptions.getAzureCognitiveServicesUrl() != null && !answerCallOptions.getAzureCognitiveServicesUrl().isEmpty()) { - request.setAzureCognitiveServicesEndpointUrl(answerCallOptions.getAzureCognitiveServicesUrl()); - } - return azureCommunicationCallAutomationServiceInternal.answerCallWithResponseAsync( request, - UUID.randomUUID(), - OffsetDateTime.now(), context) .map(response -> { try { @@ -408,17 +392,15 @@ Mono> redirectCallWithResponseInternal(RedirectCallOptions redire .setTarget(CommunicationIdentifierConverter.convert(redirectCallOptions.getTargetParticipant().getTargetParticipant())); // Need to do a null check since SipHeaders and VoipHeaders are optional; If they both are null then we do not need to set custom context - if (redirectCallOptions.getTargetParticipant().getCustomContext().getSipHeaders() != null || redirectCallOptions.getTargetParticipant().getCustomContext().getVoipHeaders() != null) { - CustomContext customContext = new CustomContext(); - customContext.setSipHeaders(redirectCallOptions.getTargetParticipant().getCustomContext().getSipHeaders()); - customContext.setVoipHeaders(redirectCallOptions.getTargetParticipant().getCustomContext().getVoipHeaders()); - request.setCustomContext(customContext); + if (redirectCallOptions.getTargetParticipant().getCustomCallingContext().getSipHeaders() != null || redirectCallOptions.getTargetParticipant().getCustomCallingContext().getVoipHeaders() != null) { + CustomCallingContext customContext = new CustomCallingContext(); + customContext.setSipHeaders(redirectCallOptions.getTargetParticipant().getCustomCallingContext().getSipHeaders()); + customContext.setVoipHeaders(redirectCallOptions.getTargetParticipant().getCustomCallingContext().getVoipHeaders()); + request.setCustomCallingContext(customContext); } return azureCommunicationCallAutomationServiceInternal.redirectCallWithResponseAsync( request, - UUID.randomUUID(), - OffsetDateTime.now(), context); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -464,8 +446,6 @@ 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 ebd657cd0022e..8ccb22bcc1236 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 @@ -3,7 +3,6 @@ package com.azure.communication.callautomation; -import com.azure.communication.callautomation.models.events.AddParticipantCancelled; import com.azure.communication.callautomation.models.events.AddParticipantFailed; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallAutomationEventBase; @@ -12,6 +11,7 @@ import com.azure.communication.callautomation.models.events.CallTransferAccepted; import com.azure.communication.callautomation.models.events.CallTransferFailed; 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; @@ -33,8 +33,8 @@ 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.SendDtmfCompleted; -import com.azure.communication.callautomation.models.events.SendDtmfFailed; +import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; +import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; import com.azure.core.models.CloudEvent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.core.JsonProcessingException; @@ -136,12 +136,12 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String ret = mapper.convertValue(eventData, ContinuousDtmfRecognitionToneFailed.class); } else if (Objects.equals(eventType, "Microsoft.Communication.ContinuousDtmfRecognitionStopped")) { ret = mapper.convertValue(eventData, ContinuousDtmfRecognitionStopped.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.SendDtmfCompleted")) { - ret = mapper.convertValue(eventData, SendDtmfCompleted.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.SendDtmfFailed")) { - ret = mapper.convertValue(eventData, SendDtmfFailed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.AddParticipantCancelled")) { - ret = mapper.convertValue(eventData, AddParticipantCancelled.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.SendDtmfTonesCompleted")) { + ret = mapper.convertValue(eventData, SendDtmfTonesCompleted.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.SendDtmfTonesFailed")) { + ret = mapper.convertValue(eventData, SendDtmfTonesFailed.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.CancelAddParticipantSucceeded")) { + ret = mapper.convertValue(eventData, CancelAddParticipantSucceeded.class); } else if (Objects.equals(eventType, "Microsoft.Communication.CancelAddParticipantFailed")) { ret = mapper.convertValue(eventData, CancelAddParticipantFailed.class); } else if (Objects.equals(eventType, "Microsoft.Communication.DialogStarted")) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationServiceVersion.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationServiceVersion.java index 9045b395094fc..cae499022b2f6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationServiceVersion.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationServiceVersion.java @@ -9,15 +9,21 @@ * Versions of CallAutomation service supported by this client library. */ public enum CallAutomationServiceVersion implements ServiceVersion { + /** * Service version {@code 2023-03-06}. */ V2023_03_06("2023-03-06"), /** - * Service version {@code 2023-01-15-preview}. + * Service version {@code 2023-10-15}. + */ + V2023_10_15("2023-10-15"), + + /** + * Service version {@code 2023-10-03-preview}. */ - V2023_01_15_PREVIEW("2023-01-15-preview"); + V2023_10_03_PREVIEW("2023-10-03-preview"); private final String version; @@ -39,6 +45,6 @@ public String getVersion() { * @return The latest {@link CallAutomationServiceVersion} object. */ public static CallAutomationServiceVersion getLatest() { - return V2023_01_15_PREVIEW; + return V2023_10_03_PREVIEW; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnection.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnection.java index 5b996fa77fcde..c6dd8e2514c7f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnection.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallConnection.java @@ -4,20 +4,20 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.models.CallParticipant; -import com.azure.communication.callautomation.models.CancelAddParticipantOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; +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.AddParticipantResult; import com.azure.communication.callautomation.models.CallConnectionProperties; import com.azure.communication.callautomation.models.CallInvite; -import com.azure.communication.callautomation.models.MuteParticipantsOptions; -import com.azure.communication.callautomation.models.MuteParticipantsResult; +import com.azure.communication.callautomation.models.MuteParticipantOptions; +import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.TransferCallResult; import com.azure.communication.callautomation.models.TransferCallToParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsResult; +import com.azure.communication.callautomation.models.UnmuteParticipantOptions; +import com.azure.communication.callautomation.models.UnmuteParticipantResult; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; @@ -223,50 +223,53 @@ public Response removeParticipantWithResponse(RemovePar } /** - * Mutes participants in the call. + * Mutes a participant in the call. * * @param targetParticipant - Participant to be muted. Only ACS Users are currently supported. - * @return A MuteParticipantsResult object. + * @return A MuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MuteParticipantsResult muteParticipants(CommunicationIdentifier targetParticipant) { - return callConnectionAsync.muteParticipantsAsync(targetParticipant).block(); + public MuteParticipantResult muteParticipant(CommunicationIdentifier targetParticipant) { + return callConnectionAsync.muteParticipant(targetParticipant).block(); } /** - * Mute participants in the call. - * @param muteParticipantsOptions - Options for the request. + * Mutes a participant in the call. + * + * @param options - Options for the request. * @param context A {@link Context} representing the request context. - * @return a Response containing the MuteParticipantsResult object. + * @return a Response containing the MuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response muteParticipantsWithResponse(MuteParticipantsOptions muteParticipantsOptions, Context context) { - return callConnectionAsync.muteParticipantWithResponseInternal(muteParticipantsOptions, context).block(); + public Response muteParticipantWithResponse(MuteParticipantOptions options, Context context) { + return callConnectionAsync.muteParticipantWithResponseInternal(options, context).block(); } /** - * Unmutes participants in the call. + * Unmutes participant in the call. + * * @param targetParticipant - Participant to be unmuted. Only ACS Users are currently supported. - * @return An UnmuteParticipantsResult object. + * @return An UnmuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UnmuteParticipantsResult unmuteParticipants(CommunicationIdentifier targetParticipant) { - return callConnectionAsync.unmuteParticipantsAsync(targetParticipant).block(); + public UnmuteParticipantResult unmuteParticipant(CommunicationIdentifier targetParticipant) { + return callConnectionAsync.unmuteParticipant(targetParticipant).block(); } /** - * Unmutes participants in the call. - * @param unmuteParticipantsOptions - Options for the request. + * Unmutes participant in the call. + * + * @param options - Options for the request. * @param context A {@link Context} representing the request context. - * @return a Response containing the UnmuteParticipantsResult object. + * @return a Response containing the UnmuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response unmuteParticipantsWithResponse(UnmuteParticipantsOptions unmuteParticipantsOptions, Context context) { - return callConnectionAsync.unmuteParticipantWithResponseInternal(unmuteParticipantsOptions, context).block(); + public Response unmuteParticipantWithResponse(UnmuteParticipantOptions options, Context context) { + return callConnectionAsync.unmuteParticipantWithResponseInternal(options, context).block(); } /** - * Cancel add participant request. + * Cancel add participant operation request. * * @param invitationId invitation ID used to add participant. * @throws HttpResponseException thrown if the request is rejected by server. @@ -274,22 +277,22 @@ public Response unmuteParticipantsWithResponse(UnmuteP * @return Result of cancelling add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CancelAddParticipantResult cancelAddParticipant(String invitationId) { - return callConnectionAsync.cancelAddParticipant(invitationId).block(); + public CancelAddParticipantOperationResult cancelAddParticipantOperation(String invitationId) { + return callConnectionAsync.cancelAddParticipantOperation(invitationId).block(); } /** - * Cancel add participant request. + * Cancel add participant operation request. * - * @param cancelAddParticipantOptions The options for cancelling add participant request. + * @param cancelAddParticipantOperationOptions The options for cancelling add participant operation request. * @param context A {@link Context} representing the request context. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return Response with result of cancelling add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAddParticipantWithResponse(CancelAddParticipantOptions cancelAddParticipantOptions, Context context) { - return callConnectionAsync.cancelAddParticipantWithResponseInternal(cancelAddParticipantOptions, context).block(); + public Response cancelAddParticipantOperationWithResponse(CancelAddParticipantOperationOptions cancelAddParticipantOperationOptions, Context context) { + return callConnectionAsync.cancelAddParticipantOperationWithResponseInternal(cancelAddParticipantOperationOptions, context).block(); } //region Content management Actions 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 f9dee3a7fd9c0..c182dfe9f1c20 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 @@ -18,26 +18,26 @@ import com.azure.communication.callautomation.implementation.converters.PhoneNumberIdentifierConverter; import com.azure.communication.callautomation.implementation.models.AddParticipantRequestInternal; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantRequest; -import com.azure.communication.callautomation.implementation.models.CustomContext; +import com.azure.communication.callautomation.implementation.models.CustomCallingContext; import com.azure.communication.callautomation.implementation.models.MuteParticipantsRequestInternal; 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.AddParticipantResult; import com.azure.communication.callautomation.models.CallParticipant; -import com.azure.communication.callautomation.models.CancelAddParticipantOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; +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.MuteParticipantsOptions; -import com.azure.communication.callautomation.models.MuteParticipantsResult; +import com.azure.communication.callautomation.models.MuteParticipantOptions; +import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.TransferCallResult; import com.azure.communication.callautomation.models.TransferCallToParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsResult; +import com.azure.communication.callautomation.models.UnmuteParticipantOptions; +import com.azure.communication.callautomation.models.UnmuteParticipantResult; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.MicrosoftTeamsUserIdentifier; @@ -54,10 +54,7 @@ import com.azure.core.exception.HttpResponseException; import java.net.URISyntaxException; -import java.time.OffsetDateTime; import java.util.Collections; -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; @@ -159,8 +156,6 @@ Mono> hangUpWithResponseInternal(boolean isForEveryone, Context c return (isForEveryone ? callConnectionInternal.terminateCallWithResponseAsync( callConnectionId, - UUID.randomUUID(), - OffsetDateTime.now(), context) : callConnectionInternal.hangupCallWithResponseAsync(callConnectionId, context)); } catch (RuntimeException ex) { @@ -282,12 +277,12 @@ Mono> transferCallToParticipantWithResponseInternal TransferToParticipantRequestInternal request = new TransferToParticipantRequestInternal() .setTargetParticipant(CommunicationIdentifierConverter.convert(transferCallToParticipantOptions.getTargetParticipant())) .setOperationContext(transferCallToParticipantOptions.getOperationContext()) - .setCallbackUri(transferCallToParticipantOptions.getCallbackUrl()); + .setOperationCallbackUri(transferCallToParticipantOptions.getOperationCallbackUrl()); - if (transferCallToParticipantOptions.getCustomContext().getSipHeaders() != null || transferCallToParticipantOptions.getCustomContext().getVoipHeaders() != null) { - request.setCustomContext(new CustomContext() - .setSipHeaders(transferCallToParticipantOptions.getCustomContext().getSipHeaders()) - .setVoipHeaders(transferCallToParticipantOptions.getCustomContext().getVoipHeaders())); + if (transferCallToParticipantOptions.getCustomCallingContext().getSipHeaders() != null || transferCallToParticipantOptions.getCustomCallingContext().getVoipHeaders() != null) { + request.setCustomCallingContext(new CustomCallingContext() + .setSipHeaders(transferCallToParticipantOptions.getCustomCallingContext().getSipHeaders()) + .setVoipHeaders(transferCallToParticipantOptions.getCustomCallingContext().getVoipHeaders())); } if (transferCallToParticipantOptions.getTransferee() != null) { @@ -297,8 +292,6 @@ Mono> transferCallToParticipantWithResponseInternal return callConnectionInternal.transferToParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), context) .map(response -> { TransferCallResult result = TransferCallResponseConstructorProxy.create(response.getValue()); @@ -344,7 +337,7 @@ Mono> addParticipantWithResponseInternal(AddParti .setSourceDisplayName(addParticipantOptions.getTargetParticipant().getSourceDisplayName()) .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(addParticipantOptions.getTargetParticipant().getSourceCallerIdNumber())) .setOperationContext(addParticipantOptions.getOperationContext()) - .setCallbackUri(addParticipantOptions.getCallbackUrl()); + .setOperationCallbackUri(addParticipantOptions.getOperationCallbackUrl()); // Need to do a null check since it is optional; it might be a null and breaks the get function as well as type casting. if (addParticipantOptions.getInvitationTimeout() != null) { @@ -352,18 +345,16 @@ Mono> addParticipantWithResponseInternal(AddParti } // Need to do a null check since SipHeaders and VoipHeaders are optional; If they both are null then we do not need to set custom context - if (addParticipantOptions.getTargetParticipant().getCustomContext().getSipHeaders() != null || addParticipantOptions.getTargetParticipant().getCustomContext().getVoipHeaders() != null) { - CustomContext customContext = new CustomContext(); - customContext.setSipHeaders(addParticipantOptions.getTargetParticipant().getCustomContext().getSipHeaders()); - customContext.setVoipHeaders(addParticipantOptions.getTargetParticipant().getCustomContext().getVoipHeaders()); - request.setCustomContext(customContext); + if (addParticipantOptions.getTargetParticipant().getCustomCallingContext().getSipHeaders() != null || addParticipantOptions.getTargetParticipant().getCustomCallingContext().getVoipHeaders() != null) { + CustomCallingContext customCallingContext = new CustomCallingContext(); + customCallingContext.setSipHeaders(addParticipantOptions.getTargetParticipant().getCustomCallingContext().getSipHeaders()); + customCallingContext.setVoipHeaders(addParticipantOptions.getTargetParticipant().getCustomCallingContext().getVoipHeaders()); + request.setCustomCallingContext(customCallingContext); } return callConnectionInternal.addParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), context ).map(response -> { AddParticipantResult result = AddParticipantResponseConstructorProxy.create(response.getValue()); @@ -408,13 +399,11 @@ Mono> removeParticipantWithResponseInternal(Re RemoveParticipantRequestInternal request = new RemoveParticipantRequestInternal() .setParticipantToRemove(CommunicationIdentifierConverter.convert(removeParticipantOptions.getParticipant())) .setOperationContext(removeParticipantOptions.getOperationContext()) - .setCallbackUri(removeParticipantOptions.getCallbackUrl()); + .setOperationCallbackUri(removeParticipantOptions.getOperationCallbackUrl()); return callConnectionInternal.removeParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), context).map(response -> { RemoveParticipantResult result = RemoveParticipantResponseConstructorProxy.create(response.getValue()); result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); @@ -426,42 +415,40 @@ Mono> removeParticipantWithResponseInternal(Re } /** - * Mutes participants in the call. + * Mutes a participant in the call. + * * @param targetParticipant - Participant to be muted. Only ACS Users are currently supported. - * @return A MuteParticipantsResult object. + * @return A MuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono muteParticipantsAsync(CommunicationIdentifier targetParticipant) { + public Mono muteParticipant(CommunicationIdentifier targetParticipant) { return muteParticipantWithResponseInternal( - new MuteParticipantsOptions(Collections.singletonList(targetParticipant)), + new MuteParticipantOptions(targetParticipant), null) .flatMap(FluxUtil::toMono); } /** - * Mute participants in the call. - * @param muteParticipantsOptions - Options for the request. - * @return a Response containing the MuteParticipantsResult object. + * Mutes a participant in the call. + * + * @param options - Options for the request. + * @return Response containing the MuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> muteParticipantsWithResponse(MuteParticipantsOptions muteParticipantsOptions) { - return withContext(context -> muteParticipantWithResponseInternal(muteParticipantsOptions, context)); + public Mono> muteParticipantWithResponse(MuteParticipantOptions options) { + return withContext(context -> muteParticipantWithResponseInternal(options, context)); } - Mono> muteParticipantWithResponseInternal(MuteParticipantsOptions muteParticipantsOptions, Context context) { + Mono> muteParticipantWithResponseInternal(MuteParticipantOptions options, Context context) { try { context = context == null ? Context.NONE : context; MuteParticipantsRequestInternal request = new MuteParticipantsRequestInternal() - .setTargetParticipants(muteParticipantsOptions.getTargetParticipant().stream() - .map(CommunicationIdentifierConverter::convert) - .collect(Collectors.toList())) - .setOperationContext(muteParticipantsOptions.getOperationContext()); + .setTargetParticipants(Collections.singletonList(CommunicationIdentifierConverter.convert(options.getTargetParticipant()))) + .setOperationContext(options.getOperationContext()); 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); @@ -469,42 +456,38 @@ Mono> muteParticipantWithResponseInternal(MuteP } /** - * Unmutes participants in the call. + * Unmutes participant in the call. * @param targetParticipant - Participant to be unmuted. Only ACS Users are currently supported. - * @return An UnmuteParticipantsResult object. + * @return An UnmuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteParticipantsAsync(CommunicationIdentifier targetParticipant) { + public Mono unmuteParticipant(CommunicationIdentifier targetParticipant) { return unmuteParticipantWithResponseInternal( - new UnmuteParticipantsOptions(Collections.singletonList(targetParticipant)), + new UnmuteParticipantOptions(targetParticipant), null) .flatMap(FluxUtil::toMono); } /** * Unmute participants in the call. - * @param unmuteParticipantsOptions - Options for the request. - * @return a Response containing the UnmuteParticipantsResult object. + * @param unmuteParticipantOptions - Options for the request. + * @return a Response containing the UnmuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteParticipantsWithResponse(UnmuteParticipantsOptions unmuteParticipantsOptions) { - return withContext(context -> unmuteParticipantWithResponseInternal(unmuteParticipantsOptions, context)); + public Mono> unmuteParticipantWithResponse(UnmuteParticipantOptions unmuteParticipantOptions) { + return withContext(context -> unmuteParticipantWithResponseInternal(unmuteParticipantOptions, context)); } - Mono> unmuteParticipantWithResponseInternal(UnmuteParticipantsOptions unmuteParticipantsOptions, Context context) { + Mono> unmuteParticipantWithResponseInternal(UnmuteParticipantOptions unmuteParticipantOptions, Context context) { try { context = context == null ? Context.NONE : context; UnmuteParticipantsRequestInternal request = new UnmuteParticipantsRequestInternal() - .setTargetParticipants(unmuteParticipantsOptions.getTargetParticipant().stream() - .map(CommunicationIdentifierConverter::convert) - .collect(Collectors.toList())) - .setOperationContext(unmuteParticipantsOptions.getOperationContext()); + .setTargetParticipants(Collections.singletonList(CommunicationIdentifierConverter.convert(unmuteParticipantOptions.getTargetParticipant()))) + .setOperationContext(unmuteParticipantOptions.getOperationContext()); 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); @@ -512,7 +495,7 @@ Mono> unmuteParticipantWithResponseInternal(U } /** - * Cancel add participant request. + * Cancel add participant operation request. * * @param invitationId invitation ID used to add participant. * @throws HttpResponseException thrown if the request is rejected by server. @@ -520,39 +503,37 @@ Mono> unmuteParticipantWithResponseInternal(U * @return Result of cancelling add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAddParticipant(String invitationId) { - return cancelAddParticipantWithResponse(new CancelAddParticipantOptions(invitationId)).flatMap(FluxUtil::toMono); + public Mono cancelAddParticipantOperation(String invitationId) { + return cancelAddParticipantOperationWithResponse(new CancelAddParticipantOperationOptions(invitationId)).flatMap(FluxUtil::toMono); } /** - * Cancel add participant request. + * Cancel add participant operation request. * - * @param cancelAddParticipantOptions Options bag for cancelAddParticipant. + * @param cancelAddParticipantOperationOptions Options bag for cancelAddParticipantOperationOptions. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return Response with result of cancelling add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAddParticipantWithResponse(CancelAddParticipantOptions cancelAddParticipantOptions) { - return withContext(context -> cancelAddParticipantWithResponseInternal(cancelAddParticipantOptions, context)); + public Mono> cancelAddParticipantOperationWithResponse(CancelAddParticipantOperationOptions cancelAddParticipantOperationOptions) { + return withContext(context -> cancelAddParticipantOperationWithResponseInternal(cancelAddParticipantOperationOptions, context)); } - Mono> cancelAddParticipantWithResponseInternal(CancelAddParticipantOptions cancelAddParticipantOptions, Context context) { + Mono> cancelAddParticipantOperationWithResponseInternal(CancelAddParticipantOperationOptions cancelAddParticipantOperationOptions, Context context) { try { context = context == null ? Context.NONE : context; CancelAddParticipantRequest request = new CancelAddParticipantRequest() - .setInvitationId((cancelAddParticipantOptions.getInvitationId())) - .setOperationContext(cancelAddParticipantOptions.getOperationContext()) - .setCallbackUri(cancelAddParticipantOptions.getCallbackUrl()); + .setInvitationId((cancelAddParticipantOperationOptions.getInvitationId())) + .setOperationContext(cancelAddParticipantOperationOptions.getOperationContext()) + .setOperationCallbackUri(cancelAddParticipantOperationOptions.getOperationCallbackUrl()); return callConnectionInternal.cancelAddParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), context).map(response -> { - CancelAddParticipantResult result = CancelAddParticipantResponseConstructorProxy.create(response.getValue()); + CancelAddParticipantOperationResult result = CancelAddParticipantResponseConstructorProxy.create(response.getValue()); result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); return new SimpleResponse<>(response, result); }); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialogAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialogAsync.java index 0ed777427e0da..a7448cb3c8adf 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialogAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialogAsync.java @@ -5,10 +5,13 @@ import com.azure.communication.callautomation.implementation.CallDialogsImpl; import com.azure.communication.callautomation.implementation.accesshelpers.DialogStateResponseConstructorProxy; -import com.azure.communication.callautomation.implementation.models.DialogOptions; +import com.azure.communication.callautomation.implementation.models.BaseDialog; import com.azure.communication.callautomation.implementation.models.StartDialogRequestInternal; +import com.azure.communication.callautomation.implementation.models.PowerVirtualAgentsDialog; +import com.azure.communication.callautomation.implementation.models.AzureOpenAIDialog; import com.azure.communication.callautomation.models.DialogStateResult; import com.azure.communication.callautomation.models.StartDialogOptions; +import com.azure.communication.callautomation.models.DialogInputType; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; @@ -69,12 +72,18 @@ Mono> startDialogWithResponseInternal(StartDialogOpt try { context = context == null ? Context.NONE : context; - DialogOptions dialogOptions = new DialogOptions(); - dialogOptions.setDialogContext(startDialogOptions.getDialogContext()); - dialogOptions.setBotAppId(startDialogOptions.getBotId()); + BaseDialog baseDialog = null; + if (startDialogOptions.getDialogInputType() == DialogInputType.POWER_VIRTUAL_AGENTS) { + baseDialog = new PowerVirtualAgentsDialog() + .setBotAppId(startDialogOptions.getBotId()) + .setContext(startDialogOptions.getDialogContext()); + } else if (startDialogOptions.getDialogInputType() == DialogInputType.AZURE_OPEN_AI) { + baseDialog = new AzureOpenAIDialog() + .setContext(startDialogOptions.getDialogContext()); + } StartDialogRequestInternal requestInternal = new StartDialogRequestInternal() - .setDialogOptions(dialogOptions) + .setDialog(baseDialog) .setOperationContext(startDialogOptions.getOperationContext()); return dialogsInternal.startDialogWithResponseAsync(callConnectionId, startDialogOptions.getDialogId(), requestInternal, context). @@ -107,8 +116,8 @@ public Mono> stopDialogWithResponse(String dialogId) { Mono> stopDialogWithResponseInternal(String dialogId, Context context) { try { context = context == null ? Context.NONE : context; - - return dialogsInternal.stopDialogWithResponseAsync(callConnectionId, dialogId, context); + // TODO: FIX OperationCallbackUri + return dialogsInternal.stopDialogWithResponseAsync(callConnectionId, dialogId, null, context); } catch (RuntimeException e) { return monoError(logger, e); } 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 162bdb1c4d8c8..7056a9f9a5816 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 @@ -3,12 +3,15 @@ package com.azure.communication.callautomation; +import com.azure.communication.callautomation.models.CallMediaRecognizeOptions; +import com.azure.communication.callautomation.models.ContinuousDtmfRecognitionOptions; import com.azure.communication.callautomation.models.DtmfTone; import com.azure.communication.callautomation.models.PlayOptions; import com.azure.communication.callautomation.models.PlayToAllOptions; -import com.azure.communication.callautomation.models.PlaySource; -import com.azure.communication.callautomation.models.CallMediaRecognizeOptions; +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.PlaySource; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; @@ -153,26 +156,23 @@ public Response cancelAllMediaOperationsWithResponse(Context context) { * * @param tones tones to be sent * @param targetParticipant the target participant + * @return Response for successful sendDtmfTones request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void sendDtmf(List tones, CommunicationIdentifier targetParticipant) { - callMediaAsync.sendDtmf(tones, targetParticipant).block(); + public SendDtmfTonesResult sendDtmfTones(List tones, CommunicationIdentifier targetParticipant) { + return callMediaAsync.sendDtmfTones(tones, targetParticipant).block(); } - /** + /** * Sends Dtmf tones * - * @param tones tones to be sent - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) - * @param callbackUrl the call back URI override to set (pass null if not applicable) + * @param options SendDtmfTones configuration options * @param context Context - * @return Response for successful sendDtmf request. + * @return Response for successful sendDtmfTones request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendDtmfWithResponse(List tones, CommunicationIdentifier targetParticipant, - String operationContext, String callbackUrl, Context context) { - return callMediaAsync.sendDtmfWithResponseInternal(targetParticipant, tones, operationContext, callbackUrl, context).block(); + public Response sendDtmfTonesWithResponse(SendDtmfTonesOptions options, Context context) { + return callMediaAsync.sendDtmfTonesWithResponseInternal(options, context).block(); } /** @@ -187,14 +187,13 @@ public void startContinuousDtmfRecognition(CommunicationIdentifier targetPartici /** * Starts continuous Dtmf recognition. * - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) + * @param options ContinuousDtmfRecognition configuration options * @param context Context * @return Response for successful start continuous dtmf recognition request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startContinuousDtmfRecognitionWithResponse(CommunicationIdentifier targetParticipant, String operationContext, Context context) { - return callMediaAsync.startContinuousDtmfRecognitionWithResponseInternal(targetParticipant, operationContext, context).block(); + public Response startContinuousDtmfRecognitionWithResponse(ContinuousDtmfRecognitionOptions options, Context context) { + return callMediaAsync.startContinuousDtmfRecognitionWithResponseInternal(options, context).block(); } /** @@ -208,15 +207,13 @@ public void stopContinuousDtmfRecognition(CommunicationIdentifier targetParticip /** * Stops continuous Dtmf recognition. - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) + * @param options ContinuousDtmfRecognition configuration options * @param context Context - * @param callbackUrl the call back URI override to set (pass null if not applicable) * @return Response for successful stop continuous dtmf recognition request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopContinuousDtmfRecognitionWithResponse(CommunicationIdentifier targetParticipant, String operationContext, String callbackUrl, Context context) { - return callMediaAsync.stopContinuousDtmfRecognitionWithResponseInternal(targetParticipant, operationContext, callbackUrl, context).block(); + public Response stopContinuousDtmfRecognitionWithResponse(ContinuousDtmfRecognitionOptions options, Context context) { + return callMediaAsync.stopContinuousDtmfRecognitionWithResponseInternal(options, context).block(); } /** @@ -250,7 +247,7 @@ public Response startHoldMusicWithResponse(StartHoldMusicOptions options, */ @ServiceMethod(returns = ReturnType.SINGLE) public Void stopHoldMusic(CommunicationIdentifier targetParticipant) { - return callMediaAsync.stopHoldMusicAsync(targetParticipant).block(); + return callMediaAsync.stopHoldMusic(targetParticipant).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 e7cf5c239e154..bf6c5ebdd0c3b 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 @@ -4,50 +4,57 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.CallMediasImpl; +import com.azure.communication.callautomation.implementation.accesshelpers.SendDtmfTonesResponseConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; import com.azure.communication.callautomation.implementation.models.ContinuousDtmfRecognitionRequestInternal; import com.azure.communication.callautomation.implementation.models.DtmfOptionsInternal; import com.azure.communication.callautomation.implementation.models.DtmfToneInternal; import com.azure.communication.callautomation.implementation.models.FileSourceInternal; -import com.azure.communication.callautomation.implementation.models.GenderTypeInternal; -import com.azure.communication.callautomation.implementation.models.StartHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.TextSourceInternal; -import com.azure.communication.callautomation.implementation.models.SsmlSourceInternal; import com.azure.communication.callautomation.implementation.models.PlayOptionsInternal; -import com.azure.communication.callautomation.implementation.models.SpeechOptionsInternal; import com.azure.communication.callautomation.implementation.models.PlayRequest; import com.azure.communication.callautomation.implementation.models.PlaySourceInternal; import com.azure.communication.callautomation.implementation.models.PlaySourceTypeInternal; -import com.azure.communication.callautomation.implementation.models.RecognizeChoiceInternal; +import com.azure.communication.callautomation.implementation.models.RecognitionChoiceInternal; import com.azure.communication.callautomation.implementation.models.RecognizeInputTypeInternal; import com.azure.communication.callautomation.implementation.models.RecognizeOptionsInternal; import com.azure.communication.callautomation.implementation.models.RecognizeRequest; -import com.azure.communication.callautomation.implementation.models.SendDtmfRequestInternal; -import com.azure.communication.callautomation.models.PlayToAllOptions; +import com.azure.communication.callautomation.implementation.models.SendDtmfTonesRequestInternal; +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.StopHoldMusicRequestInternal; +import com.azure.communication.callautomation.implementation.models.TextSourceInternal; +import com.azure.communication.callautomation.implementation.models.VoiceKindInternal; import com.azure.communication.callautomation.models.CallMediaRecognizeChoiceOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeDtmfOptions; +import com.azure.communication.callautomation.models.CallMediaRecognizeOptions; +import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOptions; +import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOrDtmfOptions; +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.PlayOptions; import com.azure.communication.callautomation.models.PlaySource; -import com.azure.communication.callautomation.models.RecognizeChoice; +import com.azure.communication.callautomation.models.PlayToAllOptions; +import com.azure.communication.callautomation.models.RecognitionChoice; +import com.azure.communication.callautomation.models.SendDtmfTonesOptions; +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.TextSource; -import com.azure.communication.callautomation.models.SsmlSource; -import com.azure.communication.callautomation.models.CallMediaRecognizeOptions; -import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOptions; -import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOrDtmfOptions; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.core.exception.HttpResponseException; import reactor.core.publisher.Mono; +import java.time.Duration; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -80,7 +87,7 @@ public final class CallMediaAsync { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono play(List playSources, List playTo) { - PlayOptions options = new PlayOptions(playSources.get(0), playTo); + PlayOptions options = new PlayOptions(playSources, playTo); return playWithResponse(options).flatMap(FluxUtil::toMono); } @@ -109,7 +116,7 @@ public Mono play(PlaySource playSource, List play */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playToAll(List playSources) { - PlayToAllOptions options = new PlayToAllOptions(playSources.get(0)); + PlayToAllOptions options = new PlayToAllOptions(playSources); return playToAllWithResponse(options).flatMap(FluxUtil::toMono); } /** @@ -240,10 +247,10 @@ Mono> playWithResponseInternal(PlayOptions options, Context conte Mono> playToAllWithResponseInternal(PlayToAllOptions options, Context context) { try { - PlayOptions playOptions = new PlayOptions(options.getPlaySource(), Collections.emptyList()); + PlayOptions playOptions = new PlayOptions(options.getPlaySources(), Collections.emptyList()); playOptions.setLoop(options.isLoop()); playOptions.setOperationContext(options.getOperationContext()); - playOptions.setCallbackUrl(options.getCallbackUrl()); + playOptions.setOperationCallbackUrl(options.getOperationCallbackUrl()); return playWithResponseInternal(playOptions, context); } catch (RuntimeException ex) { @@ -252,11 +259,26 @@ Mono> playToAllWithResponseInternal(PlayToAllOptions options, Con } PlayRequest getPlayRequest(PlayOptions options) { - PlaySourceInternal playSourceInternal = convertPlaySourceToPlaySourceInternal(options.getPlaySource()); + List playSourcesInternal = new ArrayList<>(); + for (PlaySource source: options.getPlaySources()) { + PlaySourceInternal playSourceInternal = null; + if (source instanceof FileSource) { + playSourceInternal = getPlaySourceInternalFromFileSource((FileSource) source); + } else if (source instanceof TextSource) { + playSourceInternal = getPlaySourceInternalFromTextSource((TextSource) source); + } else if (source instanceof SsmlSource) { + playSourceInternal = getPlaySourceInternalFromSsmlSource((SsmlSource) source); + } + if (playSourceInternal != null && playSourceInternal.getKind() != null) { + playSourcesInternal.add(playSourceInternal); + } else { + throw logger.logExceptionAsError(new IllegalArgumentException(source.getClass().getCanonicalName())); + } + } - if (playSourceInternal.getSourceType() != null) { + if (!playSourcesInternal.isEmpty()) { PlayRequest request = new PlayRequest() - .setPlaySourceInfo(playSourceInternal) + .setPlaySources(playSourcesInternal) .setPlayTo( options.getPlayTo() .stream() @@ -265,26 +287,26 @@ PlayRequest getPlayRequest(PlayOptions options) { request.setPlayOptions(new PlayOptionsInternal().setLoop(options.isLoop())); request.setOperationContext(options.getOperationContext()); - request.setCallbackUri(options.getCallbackUrl()); + request.setOperationCallbackUri(options.getOperationCallbackUrl()); return request; } - throw logger.logExceptionAsError(new IllegalArgumentException(options.getPlaySource().getClass().getCanonicalName())); + throw logger.logExceptionAsError(new IllegalArgumentException(options.getPlaySources().getClass().getCanonicalName())); } private PlaySourceInternal getPlaySourceInternalFromFileSource(FileSource playSource) { FileSourceInternal fileSourceInternal = new FileSourceInternal().setUri(playSource.getUrl()); return new PlaySourceInternal() - .setSourceType(PlaySourceTypeInternal.FILE) - .setFileSource(fileSourceInternal) - .setPlaySourceId(playSource.getPlaySourceId()); + .setKind(PlaySourceTypeInternal.FILE) + .setFile(fileSourceInternal) + .setPlaySourceCacheId(playSource.getPlaySourceCacheId()); } private PlaySourceInternal getPlaySourceInternalFromTextSource(TextSource playSource) { TextSourceInternal textSourceInternal = new TextSourceInternal().setText(playSource.getText()); - if (playSource.getVoiceGender() != null) { - textSourceInternal.setVoiceGender(GenderTypeInternal.fromString(playSource.getVoiceGender().toString())); + if (playSource.getVoiceKind() != null) { + textSourceInternal.setVoiceKind(VoiceKindInternal.fromString(playSource.getVoiceKind().toString())); } if (playSource.getSourceLocale() != null) { textSourceInternal.setSourceLocale(playSource.getSourceLocale()); @@ -297,9 +319,9 @@ private PlaySourceInternal getPlaySourceInternalFromTextSource(TextSource playSo } return new PlaySourceInternal() - .setSourceType(PlaySourceTypeInternal.TEXT) - .setTextSource(textSourceInternal) - .setPlaySourceId(playSource.getPlaySourceId()); + .setKind(PlaySourceTypeInternal.TEXT) + .setText(textSourceInternal) + .setPlaySourceCacheId(playSource.getPlaySourceCacheId()); } private PlaySourceInternal getPlaySourceInternalFromSsmlSource(SsmlSource playSource) { @@ -310,9 +332,9 @@ private PlaySourceInternal getPlaySourceInternalFromSsmlSource(SsmlSource playSo } return new PlaySourceInternal() - .setSourceType(PlaySourceTypeInternal.SSML) - .setSsmlSource(ssmlSourceInternal) - .setPlaySourceId(playSource.getPlaySourceId()); + .setKind(PlaySourceTypeInternal.SSML) + .setSsml(ssmlSourceInternal) + .setPlaySourceCacheId(playSource.getPlaySourceCacheId()); } private PlaySourceInternal convertPlaySourceToPlaySourceInternal(PlaySource playSource) { @@ -327,24 +349,24 @@ private PlaySourceInternal convertPlaySourceToPlaySourceInternal(PlaySource play return playSourceInternal; } - private List convertListRecognizeChoiceInternal(List recognizeChoices) { - return recognizeChoices.stream() - .map(this::convertRecognizeChoiceInternal) + private List convertListRecognitionChoiceInternal(List recognitionChoices) { + return recognitionChoices.stream() + .map(this::convertRecognitionChoiceInternal) .collect(Collectors.toList()); } - private RecognizeChoiceInternal convertRecognizeChoiceInternal(RecognizeChoice recognizeChoice) { - RecognizeChoiceInternal internalRecognizeChoice = new RecognizeChoiceInternal(); - if (recognizeChoice.getLabel() != null) { - internalRecognizeChoice.setLabel(recognizeChoice.getLabel()); + private RecognitionChoiceInternal convertRecognitionChoiceInternal(RecognitionChoice recognitionChoice) { + RecognitionChoiceInternal internalRecognitionChoice = new RecognitionChoiceInternal(); + if (recognitionChoice.getLabel() != null) { + internalRecognitionChoice.setLabel(recognitionChoice.getLabel()); } - if (recognizeChoice.getPhrases() != null) { - internalRecognizeChoice.setPhrases(recognizeChoice.getPhrases()); + if (recognitionChoice.getPhrases() != null) { + internalRecognitionChoice.setPhrases(recognitionChoice.getPhrases()); } - if (recognizeChoice.getTone() != null) { - internalRecognizeChoice.setTone(convertDtmfToneInternal(recognizeChoice.getTone())); + if (recognitionChoice.getTone() != null) { + internalRecognitionChoice.setTone(convertDtmfToneInternal(recognitionChoice.getTone())); } - return internalRecognizeChoice; + return internalRecognitionChoice; } private DtmfToneInternal convertDtmfToneInternal(DtmfTone dtmfTone) { @@ -353,19 +375,12 @@ private DtmfToneInternal convertDtmfToneInternal(DtmfTone dtmfTone) { private RecognizeRequest getRecognizeRequestFromDtmfConfiguration(CallMediaRecognizeOptions recognizeOptions) { CallMediaRecognizeDtmfOptions dtmfRecognizeOptions = (CallMediaRecognizeDtmfOptions) recognizeOptions; - DtmfOptionsInternal dtmfOptionsInternal = new DtmfOptionsInternal(); - dtmfOptionsInternal.setInterToneTimeoutInSeconds((int) dtmfRecognizeOptions.getInterToneTimeout().getSeconds()); - if (dtmfRecognizeOptions.getMaxTonesToCollect() != null) { - dtmfOptionsInternal.setMaxTonesToCollect(dtmfRecognizeOptions.getMaxTonesToCollect()); - } - - if (dtmfRecognizeOptions.getStopTones() != null) { - List dtmfTones = dtmfRecognizeOptions.getStopTones().stream() - .map(this::convertDtmfToneInternal) - .collect(Collectors.toList()); - dtmfOptionsInternal.setStopTones(dtmfTones); - } + DtmfOptionsInternal dtmfOptionsInternal = getDtmfOptionsInternal( + dtmfRecognizeOptions.getInterToneTimeout(), + dtmfRecognizeOptions.getMaxTonesToCollect(), + dtmfRecognizeOptions.getStopTones() + ); RecognizeOptionsInternal recognizeOptionsInternal = new RecognizeOptionsInternal() .setDtmfOptions(dtmfOptionsInternal) @@ -382,7 +397,7 @@ private RecognizeRequest getRecognizeRequestFromDtmfConfiguration(CallMediaRecog .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) - .setCallbackUri(recognizeOptions.getCallbackUrl()); + .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); return recognizeRequest; } @@ -391,7 +406,7 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec CallMediaRecognizeChoiceOptions choiceRecognizeOptions = (CallMediaRecognizeChoiceOptions) recognizeOptions; RecognizeOptionsInternal recognizeOptionsInternal = new RecognizeOptionsInternal() - .setChoices(convertListRecognizeChoiceInternal(choiceRecognizeOptions.getRecognizeChoices())) + .setChoices(convertListRecognitionChoiceInternal(choiceRecognizeOptions.getChoices())) .setInterruptPrompt(choiceRecognizeOptions.isInterruptPrompt()) .setTargetParticipant(CommunicationIdentifierConverter.convert(choiceRecognizeOptions.getTargetParticipant())); @@ -403,9 +418,9 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec } } - if (choiceRecognizeOptions.getSpeechModelEndpointId() != null) { - if (!choiceRecognizeOptions.getSpeechModelEndpointId().isEmpty()) { - recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(choiceRecognizeOptions.getSpeechModelEndpointId()); + if (choiceRecognizeOptions.getSpeechRecognitionModelEndpointId() != null) { + if (!choiceRecognizeOptions.getSpeechRecognitionModelEndpointId().isEmpty()) { + recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(choiceRecognizeOptions.getSpeechRecognitionModelEndpointId()); } } @@ -417,7 +432,7 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) - .setCallbackUri(recognizeOptions.getCallbackUrl()); + .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); return recognizeRequest; } @@ -425,7 +440,7 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRecognizeOptions recognizeOptions) { CallMediaRecognizeSpeechOptions speechRecognizeOptions = (CallMediaRecognizeSpeechOptions) recognizeOptions; - SpeechOptionsInternal speechOptionsInternal = new SpeechOptionsInternal().setEndSilenceTimeoutInMs(speechRecognizeOptions.getEndSilenceTimeoutInMs().toMillis()); + SpeechOptionsInternal speechOptionsInternal = new SpeechOptionsInternal().setEndSilenceTimeoutInMs(speechRecognizeOptions.getEndSilenceTimeout().toMillis()); RecognizeOptionsInternal recognizeOptionsInternal = new RecognizeOptionsInternal() .setSpeechOptions(speechOptionsInternal) @@ -434,9 +449,16 @@ private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRec recognizeOptionsInternal.setInitialSilenceTimeoutInSeconds((int) speechRecognizeOptions.getInitialSilenceTimeout().getSeconds()); - if (speechRecognizeOptions.getSpeechModelEndpointId() != null) { - if (!speechRecognizeOptions.getSpeechModelEndpointId().isEmpty()) { - recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(speechRecognizeOptions.getSpeechModelEndpointId()); + + if (speechRecognizeOptions.getSpeechLanguage() != null) { + if (!speechRecognizeOptions.getSpeechLanguage().isEmpty()) { + recognizeOptionsInternal.setSpeechLanguage(speechRecognizeOptions.getSpeechLanguage()); + } + } + + if (speechRecognizeOptions.getSpeechRecognitionModelEndpointId() != null) { + if (!speechRecognizeOptions.getSpeechRecognitionModelEndpointId().isEmpty()) { + recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(speechRecognizeOptions.getSpeechRecognitionModelEndpointId()); } } @@ -448,7 +470,7 @@ private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRec .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) - .setCallbackUri(recognizeOptions.getCallbackUrl()); + .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); return recognizeRequest; } @@ -456,21 +478,13 @@ private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRec private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMediaRecognizeOptions recognizeOptions) { CallMediaRecognizeSpeechOrDtmfOptions speechOrDtmfRecognizeOptions = (CallMediaRecognizeSpeechOrDtmfOptions) recognizeOptions; - DtmfOptionsInternal dtmfOptionsInternal = new DtmfOptionsInternal(); - dtmfOptionsInternal.setInterToneTimeoutInSeconds((int) speechOrDtmfRecognizeOptions.getInterToneTimeout().getSeconds()); - - if (speechOrDtmfRecognizeOptions.getMaxTonesToCollect() != null) { - dtmfOptionsInternal.setMaxTonesToCollect(speechOrDtmfRecognizeOptions.getMaxTonesToCollect()); - } - - if (speechOrDtmfRecognizeOptions.getStopTones() != null) { - List dtmfTones = speechOrDtmfRecognizeOptions.getStopTones().stream() - .map(this::convertDtmfToneInternal) - .collect(Collectors.toList()); - dtmfOptionsInternal.setStopTones(dtmfTones); - } + DtmfOptionsInternal dtmfOptionsInternal = getDtmfOptionsInternal( + speechOrDtmfRecognizeOptions.getInterToneTimeout(), + speechOrDtmfRecognizeOptions.getMaxTonesToCollect(), + speechOrDtmfRecognizeOptions.getStopTones() + ); - SpeechOptionsInternal speechOptionsInternal = new SpeechOptionsInternal().setEndSilenceTimeoutInMs(speechOrDtmfRecognizeOptions.getEndSilenceTimeoutInMs().toMillis()); + SpeechOptionsInternal speechOptionsInternal = new SpeechOptionsInternal().setEndSilenceTimeoutInMs(speechOrDtmfRecognizeOptions.getEndSilenceTimeout().toMillis()); RecognizeOptionsInternal recognizeOptionsInternal = new RecognizeOptionsInternal() .setSpeechOptions(speechOptionsInternal) @@ -478,12 +492,17 @@ private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMe .setInterruptPrompt(speechOrDtmfRecognizeOptions.isInterruptPrompt()) .setTargetParticipant(CommunicationIdentifierConverter.convert(speechOrDtmfRecognizeOptions.getTargetParticipant())); - if (speechOrDtmfRecognizeOptions.getSpeechModelEndpointId() != null) { - if (!speechOrDtmfRecognizeOptions.getSpeechModelEndpointId().isEmpty()) { - recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(speechOrDtmfRecognizeOptions.getSpeechModelEndpointId()); + recognizeOptionsInternal.setInitialSilenceTimeoutInSeconds((int) speechOrDtmfRecognizeOptions.getInitialSilenceTimeout().getSeconds()); + if (speechOrDtmfRecognizeOptions.getSpeechLanguage() != null) { + if (!speechOrDtmfRecognizeOptions.getSpeechLanguage().isEmpty()) { + recognizeOptionsInternal.setSpeechLanguage(speechOrDtmfRecognizeOptions.getSpeechLanguage()); + } + } + if (speechOrDtmfRecognizeOptions.getSpeechRecognitionModelEndpointId() != null) { + if (!speechOrDtmfRecognizeOptions.getSpeechRecognitionModelEndpointId().isEmpty()) { + recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(speechOrDtmfRecognizeOptions.getSpeechRecognitionModelEndpointId()); } } - recognizeOptionsInternal.setInitialSilenceTimeoutInSeconds((int) speechOrDtmfRecognizeOptions.getInitialSilenceTimeout().getSeconds()); PlaySourceInternal playSourceInternal = getPlaySourceInternalFromRecognizeOptions(recognizeOptions); @@ -493,11 +512,26 @@ private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMe .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) - .setCallbackUri(recognizeOptions.getCallbackUrl()); + .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); return recognizeRequest; } + private DtmfOptionsInternal getDtmfOptionsInternal(Duration interToneTimeout, Integer maxTonesToCollect, List stopTones) { + DtmfOptionsInternal dtmfOptionsInternal = new DtmfOptionsInternal(); + dtmfOptionsInternal.setInterToneTimeoutInSeconds((int) interToneTimeout.getSeconds()); + if (maxTonesToCollect != null) { + dtmfOptionsInternal.setMaxTonesToCollect(maxTonesToCollect); + } + if (stopTones != null) { + List dtmfTones = stopTones.stream() + .map(this::convertDtmfToneInternal) + .collect(Collectors.toList()); + dtmfOptionsInternal.setStopTones(dtmfTones); + } + return dtmfOptionsInternal; + } + private PlaySourceInternal getPlaySourceInternalFromRecognizeOptions(CallMediaRecognizeOptions recognizeOptions) { PlaySourceInternal playSourceInternal = null; if (recognizeOptions.getPlayPrompt() != null) { @@ -512,69 +546,67 @@ private PlaySourceInternal getPlaySourceInternalFromRecognizeOptions(CallMediaRe * * @param tones tones to be sent * @param targetParticipant the target participant - * @return Response for successful sendDtmf request. + * @return Response for successful sendDtmfTones request. */ - public Mono sendDtmf(List tones, CommunicationIdentifier targetParticipant) { - return sendDtmfWithResponse(tones, targetParticipant, null, null).then(); + public Mono sendDtmfTones(List tones, CommunicationIdentifier targetParticipant) { + return sendDtmfTonesWithResponse(new SendDtmfTonesOptions(tones, targetParticipant)).flatMap(FluxUtil::toMono); } /** * Send DTMF tones * - * @param tones tones to be sent - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) - * @param callbackUrl the call back URI override to set (pass null if not applicable) - * @return Response for successful sendDtmf request. + * @param options SendDtmfTones configuration options + * @return Response for successful sendDtmfTones request. */ - public Mono> sendDtmfWithResponse(List tones, CommunicationIdentifier targetParticipant, String operationContext, String callbackUrl) { - return withContext(context -> sendDtmfWithResponseInternal(targetParticipant, tones, operationContext, callbackUrl, context)); + public Mono> sendDtmfTonesWithResponse(SendDtmfTonesOptions options) { + return withContext(context -> sendDtmfTonesWithResponseInternal(options, context)); } - Mono> sendDtmfWithResponseInternal(CommunicationIdentifier targetParticipant, List tones, String operationContext, String callbackUrl, Context context) { + Mono> sendDtmfTonesWithResponseInternal(SendDtmfTonesOptions options, Context context) { try { context = context == null ? Context.NONE : context; - SendDtmfRequestInternal requestInternal = new SendDtmfRequestInternal() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)) - .setTones(tones.stream() + SendDtmfTonesRequestInternal requestInternal = new SendDtmfTonesRequestInternal() + .setTargetParticipant(CommunicationIdentifierConverter.convert(options.getTargetParticipant())) + .setTones(options.getTones().stream() .map(this::convertDtmfToneInternal) .collect(Collectors.toList())) - .setOperationContext(operationContext) - .setCallbackUri(callbackUrl); - - return contentsInternal.sendDtmfWithResponseAsync(callConnectionId, requestInternal, context); + .setOperationContext(options.getOperationContext()) + .setOperationCallbackUri(options.getOperationCallbackUrl()); + + return contentsInternal.sendDtmfTonesWithResponseAsync( + callConnectionId, + requestInternal, + context + ).map(response -> new SimpleResponse<>(response, SendDtmfTonesResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException e) { return monoError(logger, e); } } - /** * Starts continuous Dtmf recognition. - * * @param targetParticipant the target participant * @return void */ public Mono startContinuousDtmfRecognition(CommunicationIdentifier targetParticipant) { - return startContinuousDtmfRecognitionWithResponse(targetParticipant, null).then(); + return startContinuousDtmfRecognitionWithResponse(new ContinuousDtmfRecognitionOptions(targetParticipant)).then(); } /** * Starts continuous Dtmf recognition. - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) + * @param options ContinuousDtmfRecognition configuration options * @return Response for successful start continuous dtmf recognition request. */ - public Mono> startContinuousDtmfRecognitionWithResponse(CommunicationIdentifier targetParticipant, String operationContext) { - return withContext(context -> startContinuousDtmfRecognitionWithResponseInternal(targetParticipant, operationContext, context)); + public Mono> startContinuousDtmfRecognitionWithResponse(ContinuousDtmfRecognitionOptions options) { + return withContext(context -> startContinuousDtmfRecognitionWithResponseInternal(options, context)); } - Mono> startContinuousDtmfRecognitionWithResponseInternal(CommunicationIdentifier targetParticipant, String operationContext, Context context) { + Mono> startContinuousDtmfRecognitionWithResponseInternal(ContinuousDtmfRecognitionOptions options, Context context) { try { context = context == null ? Context.NONE : context; ContinuousDtmfRecognitionRequestInternal requestInternal = new ContinuousDtmfRecognitionRequestInternal() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)) - .setOperationContext(operationContext); + .setTargetParticipant(CommunicationIdentifierConverter.convert(options.getTargetParticipant())) + .setOperationContext(options.getOperationContext()); return contentsInternal.startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, requestInternal, context); } catch (RuntimeException e) { @@ -588,27 +620,25 @@ Mono> startContinuousDtmfRecognitionWithResponseInternal(Communic * @return void */ public Mono stopContinuousDtmfRecognition(CommunicationIdentifier targetParticipant) { - return stopContinuousDtmfRecognitionWithResponse(targetParticipant, null, null).then(); + return stopContinuousDtmfRecognitionWithResponse(new ContinuousDtmfRecognitionOptions(targetParticipant)).then(); } /** * Stops continuous Dtmf recognition. - * @param targetParticipant the target participant - * @param operationContext operationContext (pass null if not applicable) - * @param callbackUrl the call back URI override to set (pass null if not applicable) + * @param options ContinuousDtmfRecognition configuration options * @return Response for successful stop continuous dtmf recognition request. */ - public Mono> stopContinuousDtmfRecognitionWithResponse(CommunicationIdentifier targetParticipant, String operationContext, String callbackUrl) { - return withContext(context -> stopContinuousDtmfRecognitionWithResponseInternal(targetParticipant, operationContext, callbackUrl, context)); + public Mono> stopContinuousDtmfRecognitionWithResponse(ContinuousDtmfRecognitionOptions options) { + return withContext(context -> stopContinuousDtmfRecognitionWithResponseInternal(options, context)); } - Mono> stopContinuousDtmfRecognitionWithResponseInternal(CommunicationIdentifier targetParticipant, String operationContext, String callbackUrl, Context context) { + Mono> stopContinuousDtmfRecognitionWithResponseInternal(ContinuousDtmfRecognitionOptions options, Context context) { try { context = context == null ? Context.NONE : context; ContinuousDtmfRecognitionRequestInternal requestInternal = new ContinuousDtmfRecognitionRequestInternal() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)) - .setOperationContext(operationContext) - .setCallbackUri(callbackUrl); + .setTargetParticipant(CommunicationIdentifierConverter.convert(options.getTargetParticipant())) + .setOperationContext(options.getOperationContext()) + .setOperationCallbackUri(options.getOperationCallbackUrl()); return contentsInternal.stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, requestInternal, context); } catch (RuntimeException e) { @@ -664,8 +694,8 @@ Mono> startHoldMusicWithResponseInternal(StartHoldMusicOptions op * @return Response for successful operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopHoldMusicAsync(CommunicationIdentifier targetParticipant) { - return stopHoldMusicWithResponseAsync(targetParticipant, null).then(); + public Mono stopHoldMusic(CommunicationIdentifier targetParticipant) { + return stopHoldMusicWithResponse(targetParticipant, null).then(); } /** @@ -675,7 +705,7 @@ public Mono stopHoldMusicAsync(CommunicationIdentifier targetParticipant) * @return Response for successful operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponseAsync(CommunicationIdentifier targetParticipant, + public Mono> stopHoldMusicWithResponse(CommunicationIdentifier targetParticipant, String operationContext) { return withContext(context -> stopHoldMusicWithResponseInternal(targetParticipant, operationContext, context)); } 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 c4f48ddde3c25..8d4e5534cab57 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 @@ -51,12 +51,10 @@ 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; @@ -122,8 +120,6 @@ 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 451c612f96621..73ecfe7f45b2d 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,7 +23,6 @@ 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; @@ -37,101 +36,121 @@ 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() { @@ -140,23 +159,18 @@ 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(), new CookiePolicy()) - .build(), - JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - apiVersion); + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).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. @@ -167,14 +181,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; @@ -183,11 +197,8 @@ 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()); } /** @@ -198,803 +209,443 @@ 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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") CreateCallRequestInternal createCallRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @Post("/calling/callConnections:answer") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - 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); + 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); @Post("/calling/callConnections:redirect") - @ExpectedResponses({204}) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - 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); + 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); @Post("/calling/callConnections:reject") - @ExpectedResponses({204}) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - 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); + 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); } /** * 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. + * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createCallWithResponseAsync( - CreateCallRequestInternal createCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> + createCallWithResponseAsync(CreateCallRequestInternal createCallRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return FluxUtil.withContext( - context -> - service.createCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - createCallRequest, - accept, - context)); + 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)); } /** * 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. + * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createCallWithResponseAsync( - CreateCallRequestInternal createCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> + createCallWithResponseAsync(CreateCallRequestInternal createCallRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.createCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - createCallRequest, - accept, - context); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + return service.createCall(this.getEndpoint(), this.getApiVersion(), createCallRequest, accept, + repeatabilityRequestId, repeatabilityFirstSent, 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. + * @return properties of a call connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono createCallAsync(CreateCallRequestInternal createCallRequest) { + return createCallWithResponseAsync(createCallRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return properties of a call connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono createCallAsync(CreateCallRequestInternal createCallRequest, + Context context) { + return createCallWithResponseAsync(createCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return properties of a call connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal createCall( - CreateCallRequestInternal createCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return createCallAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response + createCallWithResponse(CreateCallRequestInternal createCallRequest, Context context) { + return createCallWithResponseAsync(createCallRequest, context).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 Response createCallWithResponse( - CreateCallRequestInternal createCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return createCallWithResponseAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public CallConnectionPropertiesInternal createCall(CreateCallRequestInternal createCallRequest) { + return createCallWithResponse(createCallRequest, Context.NONE).getValue(); } /** + * 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. + * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> answerCallWithResponseAsync( - AnswerCallRequestInternal answerCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> + answerCallWithResponseAsync(AnswerCallRequestInternal answerCallRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return FluxUtil.withContext( - context -> - service.answerCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - answerCallRequest, - accept, - context)); + 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)); } /** + * 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. + * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> answerCallWithResponseAsync( - AnswerCallRequestInternal answerCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> + answerCallWithResponseAsync(AnswerCallRequestInternal answerCallRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.answerCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - answerCallRequest, - accept, - context); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + return service.answerCall(this.getEndpoint(), this.getApiVersion(), answerCallRequest, accept, + repeatabilityRequestId, repeatabilityFirstSent, 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. + * @return properties of a call connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono answerCallAsync(AnswerCallRequestInternal answerCallRequest) { + return answerCallWithResponseAsync(answerCallRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** + * 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. + * @return properties of a call connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono answerCallAsync(AnswerCallRequestInternal answerCallRequest, + Context context) { + return answerCallWithResponseAsync(answerCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** + * 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. + * @return properties of a call connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal answerCall( - AnswerCallRequestInternal answerCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return answerCallAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response + answerCallWithResponse(AnswerCallRequestInternal answerCallRequest, Context context) { + return answerCallWithResponseAsync(answerCallRequest, 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. - * @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 Response answerCallWithResponse( - AnswerCallRequestInternal answerCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public CallConnectionPropertiesInternal answerCall(AnswerCallRequestInternal answerCallRequest) { + return answerCallWithResponse(answerCallRequest, Context.NONE).getValue(); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> redirectCallWithResponseAsync( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> redirectCallWithResponseAsync(RedirectCallRequestInternal redirectCallRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return FluxUtil.withContext( - context -> - service.redirectCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - redirectCallRequest, - accept, - context)); + 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)); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> redirectCallWithResponseAsync( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> redirectCallWithResponseAsync(RedirectCallRequestInternal redirectCallRequest, + Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.redirectCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - redirectCallRequest, - accept, - context); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + return service.redirectCall(this.getEndpoint(), this.getApiVersion(), redirectCallRequest, accept, + repeatabilityRequestId, repeatabilityFirstSent, 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redirectCallAsync( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return redirectCallWithResponseAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap((Response res) -> Mono.empty()); + public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest) { + return redirectCallWithResponseAsync(redirectCallRequest).flatMap(ignored -> 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redirectCallAsync( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return redirectCallWithResponseAsync( - redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .flatMap((Response res) -> Mono.empty()); + public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest, Context context) { + return redirectCallWithResponseAsync(redirectCallRequest, context).flatMap(ignored -> 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redirectCall( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - redirectCallAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response redirectCallWithResponse(RedirectCallRequestInternal redirectCallRequest, Context context) { + return redirectCallWithResponseAsync(redirectCallRequest, 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. - * @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 Response redirectCallWithResponse( - RedirectCallRequestInternal redirectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return redirectCallWithResponseAsync( - redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public void redirectCall(RedirectCallRequestInternal redirectCallRequest) { + redirectCallWithResponse(redirectCallRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rejectCallWithResponseAsync( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> rejectCallWithResponseAsync(RejectCallRequestInternal rejectCallRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return FluxUtil.withContext( - context -> - service.rejectCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - rejectCallRequest, - accept, - context)); + 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)); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rejectCallWithResponseAsync( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> rejectCallWithResponseAsync(RejectCallRequestInternal rejectCallRequest, + Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.rejectCall( - this.getEndpoint(), - this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - rejectCallRequest, - accept, - context); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); + return service.rejectCall(this.getEndpoint(), this.getApiVersion(), rejectCallRequest, accept, + repeatabilityRequestId, repeatabilityFirstSent, 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rejectCallAsync( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap((Response res) -> Mono.empty()); + public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest) { + return rejectCallWithResponseAsync(rejectCallRequest).flatMap(ignored -> 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rejectCallAsync( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .flatMap((Response res) -> Mono.empty()); + public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest, Context context) { + return rejectCallWithResponseAsync(rejectCallRequest, context).flatMap(ignored -> 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rejectCall( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - rejectCallAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response rejectCallWithResponse(RejectCallRequestInternal rejectCallRequest, Context context) { + return rejectCallWithResponseAsync(rejectCallRequest, 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. - * @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 Response rejectCallWithResponse( - RejectCallRequestInternal rejectCallRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public void rejectCall(RejectCallRequestInternal rejectCallRequest) { + rejectCallWithResponse(rejectCallRequest, Context.NONE); } } 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 a02993adfc31d..69105e0ac49bc 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,227 +4,314 @@ 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.policy.CookiePolicy; +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.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 { +/** + * 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 private static final String SDK_NAME = "name"; + @Generated private static final String SDK_VERSION = "version"; - private final Map properties = new HashMap<>(); + @Generated + private static final Map PROPERTIES = new HashMap<>(); - /** Create an instance of the AzureCommunicationCallAutomationServiceImplBuilder. */ + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the AzureCommunicationCallAutomationServiceImplBuilder. + */ + @Generated public AzureCommunicationCallAutomationServiceImplBuilder() { this.pipelinePolicies = new ArrayList<>(); } /* - * The endpoint of the Azure Communication resource. + * The HTTP pipeline to send requests through. */ - private String endpoint; + @Generated + private HttpPipeline pipeline; /** - * Sets The endpoint of the Azure Communication resource. - * - * @param endpoint the endpoint value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ - public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * Api Version + * The HTTP client used to send the request. */ - private String apiVersion; + @Generated + private HttpClient httpClient; /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ - public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP pipeline to send requests through + * The logging configuration for HTTP requests and responses. */ - private HttpPipeline pipeline; + @Generated + private HttpLogOptions httpLogOptions; /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ - public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; return this; } /* - * The serializer to serialize an object into a string + * The client options such as application ID and custom headers to set on a request. */ - private SerializerAdapter serializerAdapter; + @Generated + private ClientOptions clientOptions; /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ - public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; return this; } /* - * The HTTP client used to send the request. + * The retry options to configure retry policy for failed requests. */ - private HttpClient httpClient; + @Generated + private RetryOptions retryOptions; /** - * Sets The HTTP client used to send the request. - * - * @param httpClient the httpClient value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ - public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); 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; /** - * Sets The configuration store that is used during construction of the service client. - * - * @param configuration the configuration value. - * @return the AzureCommunicationCallAutomationServiceImplBuilder. + * {@inheritDoc}. */ + @Generated + @Override public AzureCommunicationCallAutomationServiceImplBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; } /* - * The logging configuration for HTTP requests and responses. + * The AzureKeyCredential used for authentication. */ - private HttpLogOptions httpLogOptions; + @Generated + private AzureKeyCredential azureKeyCredential; /** - * Sets The logging configuration for HTTP requests and responses. - * - * @param httpLogOptions the httpLogOptions value. + * {@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 + */ + @Generated + private String apiVersion; + + /** + * Sets Api Version. + * + * @param apiVersion the apiVersion value. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; + @Generated + public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; return this; } /* - * The retry policy that will attempt to retry failed requests, if - * applicable. + * The serializer to serialize an object into a string */ - private RetryPolicy retryPolicy; + @Generated + private SerializerAdapter serializerAdapter; /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; + @Generated + public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; return this; } /* - * The list of Http pipeline policies to add. + * The retry policy that will attempt to retry failed requests, if applicable. */ - private final List pipelinePolicies; + @Generated + private RetryPolicy retryPolicy; /** - * Adds a custom Http pipeline policy. - * - * @param customPolicy The custom Http pipeline policy to add. + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. * @return the AzureCommunicationCallAutomationServiceImplBuilder. */ - public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); + @Generated + public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; return this; } /** * Builds an instance of AzureCommunicationCallAutomationServiceImpl with the provided parameters. - * + * * @return an instance of AzureCommunicationCallAutomationServiceImpl. */ + @Generated public AzureCommunicationCallAutomationServiceImpl buildClient() { - if (apiVersion == null) { - this.apiVersion = "2023-01-15-preview"; - } - if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (serializerAdapter == null) { - this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); - } - AzureCommunicationCallAutomationServiceImpl client = - new AzureCommunicationCallAutomationServiceImpl(pipeline, serializerAdapter, endpoint, apiVersion); + 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); return client; } + @Generated private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } + 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"); - policies.add( - new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration)); + 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)); + } + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); - policies.add(new CookiePolicy()); - policies.addAll(this.pipelinePolicies); + 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)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient).clientOptions(localClientOptions).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 34e21ebfdefdb..d80d13e3151ce 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 @@ -13,7 +13,7 @@ import com.azure.communication.callautomation.implementation.models.CommunicationErrorResponseException; import com.azure.communication.callautomation.implementation.models.GetParticipantsResponseInternal; import com.azure.communication.callautomation.implementation.models.MuteParticipantsRequestInternal; -import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantRequestInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; @@ -47,22 +47,28 @@ 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; } @@ -74,851 +80,615 @@ 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("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @HeaderParam("Accept") String accept, - Context context); + 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); @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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") TransferToParticipantRequestInternal transferToParticipantRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") AddParticipantRequestInternal addParticipantRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") RemoveParticipantRequestInternal removeParticipantRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") MuteParticipantsRequestInternal muteParticipantsRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @Post("/calling/callConnections/{callConnectionId}/participants:unmute") - @ExpectedResponses({202}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - 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); + 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); @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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") CancelAddParticipantRequest cancelAddParticipantRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @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 call connection. - * + * 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 call connection. + * @return the detail properties of an ongoing call along with {@link Response} on successful completion of + * {@link Mono}. */ @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 call connection. - * + * 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 call connection. + * @return the detail properties of an ongoing call along with {@link Response} on successful completion of + * {@link Mono}. */ @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 call connection. - * + * 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 call connection. + * @return the detail properties of an ongoing call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCallAsync(String callConnectionId) { - return getCallWithResponseAsync(callConnectionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getCallWithResponseAsync(callConnectionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get call connection. - * + * 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 call connection. + * @return the detail properties of an ongoing call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCallAsync(String callConnectionId, Context context) { - return getCallWithResponseAsync(callConnectionId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getCallWithResponseAsync(callConnectionId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get call connection. - * + * 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 call connection. + * @return the detail properties of an ongoing call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallConnectionPropertiesInternal getCall(String callConnectionId) { - return getCallAsync(callConnectionId).block(); + public Response getCallWithResponse(String callConnectionId, Context context) { + return getCallWithResponseAsync(callConnectionId, context).block(); } /** - * Get call connection. - * + * 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 call connection. + * @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 getCallWithResponse(callConnectionId, Context.NONE).getValue(); } /** - * Hangup the call. - * + * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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)); } /** - * Hangup the call. - * + * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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); } /** - * Hangup the call. - * + * 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono hangupCallAsync(String callConnectionId) { - return hangupCallWithResponseAsync(callConnectionId).flatMap((Response res) -> Mono.empty()); + return hangupCallWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty()); } /** - * Hangup the call. - * + * 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono hangupCallAsync(String callConnectionId, Context context) { - return hangupCallWithResponseAsync(callConnectionId, context).flatMap((Response res) -> Mono.empty()); + return hangupCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty()); } /** - * Hangup the call. - * + * 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 void hangupCall(String callConnectionId) { - hangupCallAsync(callConnectionId).block(); + public Response hangupCallWithResponse(String callConnectionId, Context context) { + return hangupCallWithResponseAsync(callConnectionId, context).block(); } /** - * Hangup the call. - * + * 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 Response hangupCallWithResponse(String callConnectionId, Context context) { - return hangupCallWithResponseAsync(callConnectionId, context).block(); + public void hangupCall(String callConnectionId) { + hangupCallWithResponse(callConnectionId, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> terminateCallWithResponseAsync( - String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { + public Mono> terminateCallWithResponseAsync(String callConnectionId) { final String accept = "application/json"; - 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)); + 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)); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> terminateCallWithResponseAsync( - String callConnectionId, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> terminateCallWithResponseAsync(String callConnectionId, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.terminateCall( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - accept, - context); + 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); } /** * 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateCallAsync( - String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { - return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap((Response res) -> Mono.empty()); + public Mono terminateCallAsync(String callConnectionId) { + return terminateCallWithResponseAsync(callConnectionId).flatMap(ignored -> 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateCallAsync( - String callConnectionId, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context) - .flatMap((Response res) -> Mono.empty()); + public Mono terminateCallAsync(String callConnectionId, Context context) { + return terminateCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateCall( - String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) { - terminateCallAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response terminateCallWithResponse(String callConnectionId, Context context) { + return terminateCallWithResponseAsync(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. - * @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 Response terminateCallWithResponse( - String callConnectionId, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public void terminateCall(String callConnectionId) { + terminateCallWithResponse(callConnectionId, Context.NONE); } /** * 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. + * @return the response payload for transferring the call along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> transferToParticipantWithResponseAsync( - String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> transferToParticipantWithResponseAsync(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest) { final String accept = "application/json"; - 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)); + 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)); } /** * 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. + * @return the response payload for transferring the call along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> transferToParticipantWithResponseAsync( - String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> transferToParticipantWithResponseAsync(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.transferToParticipant( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - transferToParticipantRequest, - accept, - context); + 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); } /** * 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. + * @return the response payload for transferring the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono transferToParticipantAsync(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest) { + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response payload for transferring the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono transferToParticipantAsync(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response payload for transferring the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TransferCallResponseInternal transferToParticipant( - String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return transferToParticipantAsync( - callConnectionId, transferToParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response transferToParticipantWithResponse(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest, Context context) { + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, 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. - * @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 Response transferToParticipantWithResponse( - String callConnectionId, - TransferToParticipantRequestInternal transferToParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return transferToParticipantWithResponseAsync( - callConnectionId, - transferToParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public TransferCallResponseInternal transferToParticipant(String callConnectionId, + TransferToParticipantRequestInternal transferToParticipantRequest) { + return transferToParticipantWithResponse(callConnectionId, transferToParticipantRequest, Context.NONE) + .getValue(); } /** * 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. + * @return participants from a call along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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().getValues(), - 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. + * @return participants from a call along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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().getValues(), - 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. + * @return participants from a call as paginated response with {@link PagedFlux}. */ @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. + * @return participants from a call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux getParticipantsAsync(String callConnectionId, Context context) { - return new PagedFlux<>( - () -> getParticipantsSinglePageAsync(callConnectionId, context), - nextLink -> getParticipantsNextSinglePageAsync(nextLink, 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(); } /** * 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. + * @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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getParticipants(String callConnectionId) { @@ -927,13 +697,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. + * @return participants from a call as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getParticipants(String callConnectionId, Context context) { @@ -941,1290 +711,741 @@ public PagedIterable getParticipants(String callConnect } /** - * Add participants to the call. - * + * 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. + * @return the response payload for adding participants to the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addParticipantWithResponseAsync( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> addParticipantWithResponseAsync(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( - context -> - service.addParticipant( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - addParticipantRequest, - accept, - context)); + context -> service.addParticipant(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), + addParticipantRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); } /** - * Add participants to the call. - * + * 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. + * @return the response payload for adding participants to the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addParticipantWithResponseAsync( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> addParticipantWithResponseAsync(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.addParticipant( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - addParticipantRequest, - accept, - context); - } - - /** - * Add participants to the call. - * + 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); + } + + /** + * 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. + * @return the response payload for adding participants to the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono addParticipantAsync(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Add participants to the call. - * + * 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. + * @return the response payload for adding participants to the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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 participants to the call. - * + public Mono addParticipantAsync(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, Context context) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @return the response payload for adding participants to the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AddParticipantResponseInternal addParticipant( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return addParticipantAsync( - callConnectionId, addParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response addParticipantWithResponse(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest, Context context) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context).block(); } /** - * Add participants to the call. - * + * 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 Response addParticipantWithResponse( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return addParticipantWithResponseAsync( - callConnectionId, - addParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public AddParticipantResponseInternal addParticipant(String callConnectionId, + AddParticipantRequestInternal addParticipantRequest) { + return addParticipantWithResponse(callConnectionId, addParticipantRequest, Context.NONE).getValue(); } /** - * Remove participant from the call using identifier. - * + * 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. + * @return the response payload for removing participants of the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeParticipantWithResponseAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> removeParticipantWithResponseAsync(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest) { final String accept = "application/json"; - 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)); + 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)); } /** - * Remove participant from the call using identifier. - * + * 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. + * @return the response payload for removing participants of the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeParticipantWithResponseAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> removeParticipantWithResponseAsync(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.removeParticipant( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - removeParticipantRequest, - accept, - context); - } - - /** - * Remove participant from the call using identifier. - * + 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); + } + + /** + * 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. + * @return the response payload for removing participants of the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono removeParticipantAsync(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove participant from the call using identifier. - * + * 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. + * @return the response payload for removing participants of the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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 participant from the call using identifier. - * + public Mono removeParticipantAsync(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, Context context) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @return the response payload for removing participants of the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RemoveParticipantResponseInternal removeParticipant( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return removeParticipantAsync( - callConnectionId, removeParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response removeParticipantWithResponse(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest, Context context) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context).block(); } /** - * Remove participant from the call using identifier. - * + * 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 Response removeParticipantWithResponse( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return removeParticipantWithResponseAsync( - callConnectionId, - removeParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public RemoveParticipantResponseInternal removeParticipant(String callConnectionId, + RemoveParticipantRequestInternal removeParticipantRequest) { + return removeParticipantWithResponse(callConnectionId, removeParticipantRequest, Context.NONE).getValue(); } /** * 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 response payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> muteWithResponseAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> muteWithResponseAsync(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( - context -> - service.mute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - muteParticipantsRequest, - accept, - context)); + context -> service.mute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), + muteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, 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 response payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> muteWithResponseAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> muteWithResponseAsync(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.mute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - muteParticipantsRequest, - accept, - context); + 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); } /** * 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 response payload for muting participants from the call. + * @return the result payload for muting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono muteAsync(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 response payload for muting participants from the call. + * @return the result payload for muting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono muteAsync(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 response payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MuteParticipantsResponseInternal mute( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return muteAsync(callConnectionId, muteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response muteWithResponse(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, 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. - * @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 muting participants from the call. + * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response muteWithResponse( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return muteWithResponseAsync( - callConnectionId, - muteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public MuteParticipantsResultInternal mute(String callConnectionId, + MuteParticipantsRequestInternal muteParticipantsRequest) { + return muteWithResponse(callConnectionId, muteParticipantsRequest, Context.NONE).getValue(); } /** * 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. + * @return the response payload for unmuting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> unmuteWithResponseAsync(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( - context -> - service.unmute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - unmuteParticipantsRequest, - accept, - context)); + context -> service.unmute(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), + unmuteParticipantsRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, 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. + * @return the response payload for unmuting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> unmuteWithResponseAsync(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.unmute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - unmuteParticipantsRequest, - accept, - context); + 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); } /** * 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. + * @return the response payload for unmuting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono unmuteAsync(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { + return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response payload for unmuting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono unmuteAsync(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { + return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response payload for unmuting participants from the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UnmuteParticipantsResponseInternal unmute( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return unmuteAsync(callConnectionId, unmuteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response unmuteWithResponse(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest, Context context) { + return unmuteWithResponseAsync(callConnectionId, unmuteParticipantsRequest, 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. - * @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 Response unmuteWithResponse( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return unmuteWithResponseAsync( - callConnectionId, - unmuteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public UnmuteParticipantsResponseInternal unmute(String callConnectionId, + UnmuteParticipantsRequestInternal unmuteParticipantsRequest) { + return unmuteWithResponse(callConnectionId, unmuteParticipantsRequest, Context.NONE).getValue(); } /** * 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 the response. + * @return response payload for cancel add participant request along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAddParticipantWithResponseAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> cancelAddParticipantWithResponseAsync(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest) { final String accept = "application/json"; - 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)); + 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)); } /** * 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 the response. + * @return response payload for cancel add participant request along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAddParticipantWithResponseAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> cancelAddParticipantWithResponseAsync(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.cancelAddParticipant( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - cancelAddParticipantRequest, - accept, - context); + 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); } /** * 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 the response. + * @return response payload for cancel add participant request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono cancelAddParticipantAsync(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 the response. + * @return response payload for cancel add participant request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono cancelAddParticipantAsync(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 the response. + * @return response payload for cancel add participant request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CancelAddParticipantResponse cancelAddParticipant( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return cancelAddParticipantAsync( - callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response cancelAddParticipantWithResponse(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, 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. - * @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. + * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAddParticipantWithResponse( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return cancelAddParticipantWithResponseAsync( - callConnectionId, - cancelAddParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public CancelAddParticipantResponse cancelAddParticipant(String callConnectionId, + CancelAddParticipantRequest cancelAddParticipantRequest) { + return cancelAddParticipantWithResponse(callConnectionId, cancelAddParticipantRequest, Context.NONE).getValue(); } /** * 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. + * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. */ @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. + * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. */ @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. + * @return participant from a call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getParticipantAsync(String callConnectionId, String participantRawId) { return getParticipantWithResponseAsync(callConnectionId, participantRawId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return participant from a call on successful completion of {@link Mono}. */ @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( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return participant from a call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { - return getParticipantAsync(callConnectionId, participantRawId).block(); + public Response getParticipantWithResponse(String callConnectionId, + String participantRawId, Context context) { + return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).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 Response getParticipantWithResponse( - String callConnectionId, String participantRawId, Context context) { - return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).block(); + public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { + return getParticipantWithResponse(callConnectionId, participantRawId, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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. + * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @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().getValues(), - 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 nextLink parameter. + * + * @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. + * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @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().getValues(), - res.getValue().getNextLink(), - null)); + .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(); } } 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 1504f74c28a13..d0d0bbf82187e 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,22 +26,28 @@ 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; } @@ -53,59 +59,49 @@ 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("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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @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. @@ -113,50 +109,41 @@ public Mono> startDialogWithResponseAsync( * @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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @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. + * @return the response body on successful completion of {@link Mono}. */ @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( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** + * 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. @@ -164,158 +151,159 @@ public Mono startDialogAsync( * @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. + * @return the response body on successful completion of {@link Mono}. */ @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( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** + * 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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DialogStateResponse startDialog( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { - return startDialogAsync(callConnectionId, dialogId, startDialogRequest).block(); + public Response startDialogWithResponse(String callConnectionId, String dialogId, + StartDialogRequestInternal startDialogRequest, Context context) { + return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context).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 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 startDialogWithResponse(callConnectionId, dialogId, startDialogRequest, Context.NONE).getValue(); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync(String callConnectionId, String dialogId) { + 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, - 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. * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync(String callConnectionId, String dialogId, 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, 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopDialogAsync(String callConnectionId, String dialogId) { - return stopDialogWithResponseAsync(callConnectionId, dialogId).flatMap((Response res) -> Mono.empty()); + public Mono stopDialogAsync(String callConnectionId, String dialogId, String operationCallbackUri) { + return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri) + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopDialogAsync(String callConnectionId, String dialogId, Context context) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, context) - .flatMap((Response res) -> Mono.empty()); + public Mono stopDialogAsync(String callConnectionId, String dialogId, String operationCallbackUri, + Context context) { + return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context) + .flatMap(ignored -> 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 void stopDialog(String callConnectionId, String dialogId) { - stopDialogAsync(callConnectionId, dialogId).block(); + public Response stopDialogWithResponse(String callConnectionId, String dialogId, String operationCallbackUri, + Context context) { + return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context).block(); } /** * Stop a dialog. - * + * * @param callConnectionId The call connection id. * @param dialogId The dialog id. - * @param context The context to associate with this operation. + * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDialogWithResponse(String callConnectionId, String dialogId, Context context) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, context).block(); + public void stopDialog(String callConnectionId, String dialogId, String operationCallbackUri) { + stopDialogWithResponse(callConnectionId, dialogId, operationCallbackUri, Context.NONE); } } 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 1e81ba76e9a16..5ac901e587240 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 @@ -8,12 +8,13 @@ import com.azure.communication.callautomation.implementation.models.ContinuousDtmfRecognitionRequestInternal; import com.azure.communication.callautomation.implementation.models.PlayRequest; import com.azure.communication.callautomation.implementation.models.RecognizeRequest; -import com.azure.communication.callautomation.implementation.models.SendDtmfRequestInternal; +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.StopHoldMusicRequestInternal; import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequest; -import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionDataRequest; +import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequest; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; @@ -29,25 +30,34 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; +import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; +import java.time.OffsetDateTime; +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; } @@ -59,1379 +69,1222 @@ 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); - - @Post("/calling/callConnections/{callConnectionId}:StartTranscription") - @ExpectedResponses({202}) + 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 }) @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); - - @Post("/calling/callConnections/{callConnectionId}:StopTranscription") - @ExpectedResponses({202}) + 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); + + @Post("/calling/callConnections/{callConnectionId}:stopTranscription") + @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") StopTranscriptionRequest 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); - - @Post("/calling/callConnections/{callConnectionId}:sendDtmf") - @ExpectedResponses({202}) + 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 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> sendDtmf( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SendDtmfRequestInternal sendDtmfRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:updateTranscriptionData") - @ExpectedResponses({202}) + 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); + + @Post("/calling/callConnections/{callConnectionId}:updateTranscription") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> updateTranscriptionData( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateTranscriptionDataRequest updateTranscriptionDataRequest, - @HeaderParam("Accept") String accept, - Context context); + 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); @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest) { - return playWithResponseAsync(callConnectionId, playRequest).flatMap((Response res) -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context) - .flatMap((Response res) -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest, context).flatMap(ignored -> 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 void play(String callConnectionId, PlayRequest playRequest) { - playAsync(callConnectionId, playRequest).block(); + public Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { + return playWithResponseAsync(callConnectionId, playRequest, context).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 Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context).block(); + public void play(String callConnectionId, PlayRequest playRequest) { + playWithResponse(callConnectionId, playRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync( - String callConnectionId, StartTranscriptionRequest startTranscriptionRequest) { + public Mono> startTranscriptionWithResponseAsync(String callConnectionId, + StartTranscriptionRequest 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync( - String callConnectionId, StartTranscriptionRequest startTranscriptionRequest, Context context) { + public Mono> startTranscriptionWithResponseAsync(String callConnectionId, + StartTranscriptionRequest 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync( - String callConnectionId, StartTranscriptionRequest startTranscriptionRequest) { + public Mono startTranscriptionAsync(String callConnectionId, + StartTranscriptionRequest startTranscriptionRequest) { return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync( - String callConnectionId, StartTranscriptionRequest startTranscriptionRequest, Context context) { + public Mono startTranscriptionAsync(String callConnectionId, + StartTranscriptionRequest startTranscriptionRequest, Context context) { return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 void startTranscription(String callConnectionId, StartTranscriptionRequest startTranscriptionRequest) { - startTranscriptionAsync(callConnectionId, startTranscriptionRequest).block(); + public Response startTranscriptionWithResponse(String callConnectionId, + StartTranscriptionRequest startTranscriptionRequest, Context context) { + return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context).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 Response startTranscriptionWithResponse( - String callConnectionId, StartTranscriptionRequest startTranscriptionRequest, Context context) { - return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context).block(); + public void startTranscription(String callConnectionId, StartTranscriptionRequest startTranscriptionRequest) { + startTranscriptionWithResponse(callConnectionId, startTranscriptionRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync( - String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) { + public Mono> stopTranscriptionWithResponseAsync(String callConnectionId, + StopTranscriptionRequest 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync( - String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, Context context) { + public Mono> stopTranscriptionWithResponseAsync(String callConnectionId, + StopTranscriptionRequest 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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync( - String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) { + public Mono stopTranscriptionAsync(String callConnectionId, + StopTranscriptionRequest stopTranscriptionRequest) { return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync( - String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, Context context) { + public Mono stopTranscriptionAsync(String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, + Context context) { return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 void stopTranscription(String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) { - stopTranscriptionAsync(callConnectionId, stopTranscriptionRequest).block(); + public Response stopTranscriptionWithResponse(String callConnectionId, + StopTranscriptionRequest stopTranscriptionRequest, Context context) { + return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context).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 Response stopTranscriptionWithResponse( - String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest, Context context) { - return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context).block(); + public void stopTranscription(String callConnectionId, StopTranscriptionRequest stopTranscriptionRequest) { + stopTranscriptionWithResponse(callConnectionId, stopTranscriptionRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAllMediaOperationsAsync(String callConnectionId) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId) - .flatMap((Response res) -> Mono.empty()); + return cancelAllMediaOperationsWithResponseAsync(callConnectionId).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAllMediaOperationsAsync(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context) - .flatMap((Response res) -> Mono.empty()); + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).flatMap(ignored -> 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 void cancelAllMediaOperations(String callConnectionId) { - cancelAllMediaOperationsAsync(callConnectionId).block(); + public Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).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 Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).block(); + public void cancelAllMediaOperations(String callConnectionId) { + cancelAllMediaOperationsWithResponse(callConnectionId, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest) - .flatMap((Response res) -> Mono.empty()); + return recognizeWithResponseAsync(callConnectionId, recognizeRequest).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest, Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context) - .flatMap((Response res) -> Mono.empty()); + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).flatMap(ignored -> 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 void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { - recognizeAsync(callConnectionId, recognizeRequest).block(); + public Response recognizeWithResponse(String callConnectionId, RecognizeRequest recognizeRequest, + Context context) { + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).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 Response recognizeWithResponse( - String callConnectionId, RecognizeRequest recognizeRequest, Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).block(); + public void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { + recognizeWithResponse(callConnectionId, recognizeRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono startContinuousDtmfRecognitionAsync(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return startContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono startContinuousDtmfRecognitionAsync(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, + context).flatMap(ignored -> 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 void startContinuousDtmfRecognition( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - startContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); + public Response startContinuousDtmfRecognitionWithResponse(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, + context).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 Response startContinuousDtmfRecognitionWithResponse( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return startContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .block(); + public void startContinuousDtmfRecognition(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + startContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono stopContinuousDtmfRecognitionAsync(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono stopContinuousDtmfRecognitionAsync(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, + context).flatMap(ignored -> 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 void stopContinuousDtmfRecognition( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - stopContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); + public Response stopContinuousDtmfRecognitionWithResponse(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest, + context).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 Response stopContinuousDtmfRecognitionWithResponse( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .block(); + public void stopContinuousDtmfRecognition(String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + stopContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. + * @param sendDtmfTonesRequest The send dtmf tones 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 completion. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendDtmfWithResponseAsync( - String callConnectionId, SendDtmfRequestInternal sendDtmfRequest) { + public Mono> sendDtmfTonesWithResponseAsync(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest) { final String accept = "application/json"; + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( - context -> - service.sendDtmf( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - sendDtmfRequest, - accept, - context)); + context -> service.sendDtmfTones(this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), + sendDtmfTonesRequest, accept, repeatabilityRequestId, repeatabilityFirstSent, context)); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. + * @param sendDtmfTonesRequest The send dtmf tones 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 completion. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendDtmfWithResponseAsync( - String callConnectionId, SendDtmfRequestInternal sendDtmfRequest, Context context) { + public Mono> sendDtmfTonesWithResponseAsync(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { final String accept = "application/json"; - return service.sendDtmf( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - sendDtmfRequest, - accept, - context); + 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); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. + * @param sendDtmfTonesRequest The send dtmf tones 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 completion. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendDtmfAsync(String callConnectionId, SendDtmfRequestInternal sendDtmfRequest) { - return sendDtmfWithResponseAsync(callConnectionId, sendDtmfRequest) - .flatMap((Response res) -> Mono.empty()); + public Mono sendDtmfTonesAsync(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. + * @param sendDtmfTonesRequest The send dtmf tones 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 completion. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendDtmfAsync(String callConnectionId, SendDtmfRequestInternal sendDtmfRequest, Context context) { - return sendDtmfWithResponseAsync(callConnectionId, sendDtmfRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono sendDtmfTonesAsync(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. + * @param sendDtmfTonesRequest The send dtmf tones 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void sendDtmf(String callConnectionId, SendDtmfRequestInternal sendDtmfRequest) { - sendDtmfAsync(callConnectionId, sendDtmfRequest).block(); + public Response sendDtmfTonesWithResponse(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context).block(); } /** * Send dtmf tones. - * + * * @param callConnectionId The call connection id. - * @param sendDtmfRequest The send dtmf request. - * @param context The context to associate with this operation. + * @param sendDtmfTonesRequest The send dtmf tones 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendDtmfWithResponse( - String callConnectionId, SendDtmfRequestInternal sendDtmfRequest, Context context) { - return sendDtmfWithResponseAsync(callConnectionId, sendDtmfRequest, context).block(); + public SendDtmfTonesResultInternal sendDtmfTones(String callConnectionId, + SendDtmfTonesRequestInternal sendDtmfTonesRequest) { + return sendDtmfTonesWithResponse(callConnectionId, sendDtmfTonesRequest, Context.NONE).getValue(); } /** + * UpdateTranscription Api. + * * API to change transcription language. - * + * * @param callConnectionId The call connection id. - * @param updateTranscriptionDataRequest The updateTranscriptionData request. + * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionDataWithResponseAsync( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest) { + public Mono> updateTranscriptionWithResponseAsync(String callConnectionId, + UpdateTranscriptionRequest updateTranscriptionRequest) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.updateTranscriptionData( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - updateTranscriptionDataRequest, - 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 updateTranscriptionDataRequest The updateTranscriptionData request. + * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionDataWithResponseAsync( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest, Context context) { + public Mono> updateTranscriptionWithResponseAsync(String callConnectionId, + UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { final String accept = "application/json"; - return service.updateTranscriptionData( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - updateTranscriptionDataRequest, - 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 updateTranscriptionDataRequest The updateTranscriptionData request. + * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionDataAsync( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest) { - return updateTranscriptionDataWithResponseAsync(callConnectionId, updateTranscriptionDataRequest) - .flatMap((Response res) -> Mono.empty()); + public Mono updateTranscriptionAsync(String callConnectionId, + UpdateTranscriptionRequest updateTranscriptionRequest) { + return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest) + .flatMap(ignored -> Mono.empty()); } /** + * UpdateTranscription Api. + * * API to change transcription language. - * + * * @param callConnectionId The call connection id. - * @param updateTranscriptionDataRequest The updateTranscriptionData request. + * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionDataAsync( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest, Context context) { - return updateTranscriptionDataWithResponseAsync(callConnectionId, updateTranscriptionDataRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono updateTranscriptionAsync(String callConnectionId, + UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { + return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context) + .flatMap(ignored -> Mono.empty()); } /** + * UpdateTranscription Api. + * * API to change transcription language. - * + * * @param callConnectionId The call connection id. - * @param updateTranscriptionDataRequest The updateTranscriptionData request. + * @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 void updateTranscriptionData( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest) { - updateTranscriptionDataAsync(callConnectionId, updateTranscriptionDataRequest).block(); + public Response updateTranscriptionWithResponse(String callConnectionId, + UpdateTranscriptionRequest updateTranscriptionRequest, Context context) { + return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context).block(); } /** + * UpdateTranscription Api. + * * API to change transcription language. - * + * * @param callConnectionId The call connection id. - * @param updateTranscriptionDataRequest The updateTranscriptionData request. - * @param context The context to associate with this operation. + * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTranscriptionDataWithResponse( - String callConnectionId, UpdateTranscriptionDataRequest updateTranscriptionDataRequest, Context context) { - return updateTranscriptionDataWithResponseAsync(callConnectionId, updateTranscriptionDataRequest, context) - .block(); + public void updateTranscription(String callConnectionId, UpdateTranscriptionRequest updateTranscriptionRequest) { + updateTranscriptionWithResponse(callConnectionId, updateTranscriptionRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusicAsync( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { + public Mono startHoldMusicAsync(String callConnectionId, + StartHoldMusicRequestInternal startHoldMusicRequest) { return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @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((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 void startHoldMusic(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { - startHoldMusicAsync(callConnectionId, startHoldMusicRequest).block(); + public Response startHoldMusicWithResponse(String callConnectionId, + StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { + return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, 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. - * @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 Response startHoldMusicWithResponse( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { - return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context).block(); + public void startHoldMusic(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { + startHoldMusicWithResponse(callConnectionId, startHoldMusicRequest, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopHoldMusicAsync(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest) - .flatMap((Response res) -> Mono.empty()); + return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @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((Response res) -> Mono.empty()); + .flatMap(ignored -> 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 void stopHoldMusic(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - stopHoldMusicAsync(callConnectionId, stopHoldMusicRequest).block(); + public Response stopHoldMusicWithResponse(String callConnectionId, + StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { + return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, 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. - * @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 Response stopHoldMusicWithResponse( - String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context).block(); + public void stopHoldMusic(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { + stopHoldMusicWithResponse(callConnectionId, stopHoldMusicRequest, Context.NONE); } } 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 756dbdcb2f6b7..4e48ba94799d9 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,22 +30,28 @@ 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; } @@ -57,639 +63,507 @@ 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, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, - @BodyParam("application/json") StartCallRecordingRequestInternal startCallRecording, - @HeaderParam("Accept") String accept, - Context context); + 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); @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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startRecordingWithResponseAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + public Mono> + startRecordingWithResponseAsync(StartCallRecordingRequestInternal startCallRecording) { final String accept = "application/json"; - 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)); + 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)); } /** * 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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startRecordingWithResponseAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + public Mono> + startRecordingWithResponseAsync(StartCallRecordingRequestInternal startCallRecording, Context context) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.startRecording( - this.client.getEndpoint(), - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - startCallRecording, - accept, - context); + 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); } /** * 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. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono + startRecordingAsync(StartCallRecordingRequestInternal startCallRecording) { + return startRecordingWithResponseAsync(startCallRecording).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - }); + public Mono + startRecordingAsync(StartCallRecordingRequestInternal startCallRecording, Context context) { + return startRecordingWithResponseAsync(startCallRecording, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal startRecording( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return startRecordingAsync(startCallRecording, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response + startRecordingWithResponse(StartCallRecordingRequestInternal startCallRecording, Context context) { + return startRecordingWithResponseAsync(startCallRecording, context).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 Response startRecordingWithResponse( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return startRecordingWithResponseAsync( - startCallRecording, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public RecordingStateResponseInternal startRecording(StartCallRecordingRequestInternal startCallRecording) { + return startRecordingWithResponse(startCallRecording, Context.NONE).getValue(); } /** * 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. + * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. */ @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. + * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. */ @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. + * @return call recording properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId) { - return getRecordingPropertiesWithResponseAsync(recordingId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getRecordingPropertiesWithResponseAsync(recordingId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return call recording properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId, Context context) { return getRecordingPropertiesWithResponseAsync(recordingId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return call recording properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal getRecordingProperties(String recordingId) { - return getRecordingPropertiesAsync(recordingId).block(); + public Response getRecordingPropertiesWithResponse(String recordingId, + Context context) { + return getRecordingPropertiesWithResponseAsync(recordingId, context).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 Response getRecordingPropertiesWithResponse( - String recordingId, Context context) { - return getRecordingPropertiesWithResponseAsync(recordingId, context).block(); + public RecordingStateResponseInternal getRecordingProperties(String recordingId) { + return getRecordingPropertiesWithResponse(recordingId, Context.NONE).getValue(); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId) { - return stopRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> 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 void stopRecording(String recordingId) { - stopRecordingAsync(recordingId).block(); + public Response stopRecordingWithResponse(String recordingId, Context context) { + return stopRecordingWithResponseAsync(recordingId, context).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 Response stopRecordingWithResponse(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).block(); + public void stopRecording(String recordingId) { + stopRecordingWithResponse(recordingId, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId) { - return pauseRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> 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 void pauseRecording(String recordingId) { - pauseRecordingAsync(recordingId).block(); + public Response pauseRecordingWithResponse(String recordingId, Context context) { + return pauseRecordingWithResponseAsync(recordingId, context).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 Response pauseRecordingWithResponse(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).block(); + public void pauseRecording(String recordingId) { + pauseRecordingWithResponse(recordingId, Context.NONE); } /** * 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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 the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId) { - return resumeRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId).flatMap(ignored -> 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> 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 void resumeRecording(String recordingId) { - resumeRecordingAsync(recordingId).block(); + public Response resumeRecordingWithResponse(String recordingId, Context context) { + return resumeRecordingWithResponseAsync(recordingId, context).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 Response resumeRecordingWithResponse(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).block(); + public void resumeRecording(String recordingId) { + resumeRecordingWithResponse(recordingId, Context.NONE); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java index e2568110b0d93..3b01def16f54b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java @@ -4,7 +4,7 @@ package com.azure.communication.callautomation.implementation; /*** - * Constants to be used by CallingServer. + * Constants to be used by Call Automation. */ public final class Constants { public static final int KB = 1024; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/CancelAddParticipantResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/CancelAddParticipantResponseConstructorProxy.java index a9cbc5bd06ebc..672e4f79d67c1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/CancelAddParticipantResponseConstructorProxy.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/CancelAddParticipantResponseConstructorProxy.java @@ -4,10 +4,10 @@ package com.azure.communication.callautomation.implementation.accesshelpers; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; /** - * Helper class to access private values of {@link CancelAddParticipantResult} across package boundaries. + * Helper class to access private values of {@link CancelAddParticipantOperationResult} across package boundaries. */ public final class CancelAddParticipantResponseConstructorProxy { private static CancelAddParticipantResponseConstructorAccessor accessor; @@ -20,17 +20,17 @@ private CancelAddParticipantResponseConstructorProxy() { } */ public interface CancelAddParticipantResponseConstructorAccessor { /** - * Creates a new instance of {@link CancelAddParticipantResult} backed by an internal instance of - * {@link CancelAddParticipantResult}. + * Creates a new instance of {@link CancelAddParticipantOperationResult} backed by an internal instance of + * {@link CancelAddParticipantOperationResult}. * * @param internalResponse The internal response. - * @return A new instance of {@link CancelAddParticipantResult}. + * @return A new instance of {@link CancelAddParticipantOperationResult}. */ - CancelAddParticipantResult create(CancelAddParticipantResponse internalResponse); + CancelAddParticipantOperationResult create(CancelAddParticipantResponse internalResponse); } /** - * The method called from {@link CancelAddParticipantResult} to set it's accessor. + * The method called from {@link CancelAddParticipantOperationResult} to set it's accessor. * * @param accessor The accessor. */ @@ -39,18 +39,18 @@ public static void setAccessor(final CancelAddParticipantResponseConstructorAcce } /** - * Creates a new instance of {@link CancelAddParticipantResult} backed by an internal instance of - * {@link CancelAddParticipantResult}. + * Creates a new instance of {@link CancelAddParticipantOperationResult} backed by an internal instance of + * {@link CancelAddParticipantOperationResult}. * * @param internalResponse The internal response. - * @return A new instance of {@link CancelAddParticipantResult}. + * @return A new instance of {@link CancelAddParticipantOperationResult}. */ - public static CancelAddParticipantResult create(CancelAddParticipantResponse internalResponse) { + public static CancelAddParticipantOperationResult create(CancelAddParticipantResponse internalResponse) { // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor // is null this effectively pokes the class to set up the accessor. if (accessor == null) { - new CancelAddParticipantResult(); + new CancelAddParticipantOperationResult(); } assert accessor != null; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java index 522c699220e01..160e4e8ac3c16 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java @@ -3,11 +3,11 @@ package com.azure.communication.callautomation.implementation.accesshelpers; -import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; -import com.azure.communication.callautomation.models.MuteParticipantsResult; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; +import com.azure.communication.callautomation.models.MuteParticipantResult; /** - * Helper class to access private values of {@link MuteParticipantsResult} across package boundaries. + * Helper class to access private values of {@link MuteParticipantsResultInternal} across package boundaries. */ public final class MuteParticipantsResponseConstructorProxy { private static MuteParticipantsResponseConstructorAccessor accessor; @@ -20,17 +20,17 @@ private MuteParticipantsResponseConstructorProxy() { } */ public interface MuteParticipantsResponseConstructorAccessor { /** - * Creates a new instance of {@link MuteParticipantsResult} backed by an internal instance of - * {@link MuteParticipantsResult}. + * Creates a new instance of {@link MuteParticipantResult} backed by an internal instance of + * {@link MuteParticipantsResultInternal}. * * @param internalResponse The internal response. - * @return A new instance of {@link MuteParticipantsResult}. + * @return A new instance of {@link MuteParticipantResult}. */ - MuteParticipantsResult create(MuteParticipantsResponseInternal internalResponse); + MuteParticipantResult create(MuteParticipantsResultInternal internalResponse); } /** - * The method called from {@link MuteParticipantsResult} to set it's accessor. + * The method called from {@link MuteParticipantResult} to set it's accessor. * * @param accessor The accessor. */ @@ -39,18 +39,18 @@ public static void setAccessor(final MuteParticipantsResponseConstructorAccessor } /** - * Creates a new instance of {@link MuteParticipantsResult} backed by an internal instance of - * {@link MuteParticipantsResult}. + * Creates a new instance of {@link MuteParticipantResult} backed by an internal instance of + * {@link MuteParticipantsResultInternal}. * * @param internalResponse The internal response. - * @return A new instance of {@link MuteParticipantsResult}. + * @return A new instance of {@link MuteParticipantResult}. */ - public static MuteParticipantsResult create(MuteParticipantsResponseInternal internalResponse) { + public static MuteParticipantResult create(MuteParticipantsResultInternal internalResponse) { // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor // is null this effectively pokes the class to set up the accessor. if (accessor == null) { - new MuteParticipantsResult(); + new MuteParticipantResult(); } assert accessor != null; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/SendDtmfTonesResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/SendDtmfTonesResponseConstructorProxy.java new file mode 100644 index 0000000000000..152b8afd5bf60 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/SendDtmfTonesResponseConstructorProxy.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.implementation.accesshelpers; + +import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; +import com.azure.communication.callautomation.models.SendDtmfTonesResult; + +/** + * Helper class to access private values of {@link SendDtmfTonesResult} across package boundaries. + */ +public final class SendDtmfTonesResponseConstructorProxy { + private static SendDtmfTonesResponseConstructorAccessor accessor; + + private SendDtmfTonesResponseConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link SendDtmfTonesResponseConstructorAccessor} + * instance. + */ + public interface SendDtmfTonesResponseConstructorAccessor { + /** + * Creates a new instance of {@link SendDtmfTonesResult} backed by an internal instance of + * {@link SendDtmfTonesResult}. + * + * @param internalResponse The internal response. + * @return A new instance of {@link SendDtmfTonesResult}. + */ + SendDtmfTonesResult create(SendDtmfTonesResultInternal internalResponse); + } + + /** + * The method called from {@link SendDtmfTonesResult} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final SendDtmfTonesResponseConstructorAccessor accessor) { + SendDtmfTonesResponseConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link SendDtmfTonesResult} backed by an internal instance of + * {@link SendDtmfTonesResult}. + * + * @param internalResponse The internal response. + * @return A new instance of {@link SendDtmfTonesResult}. + */ + public static SendDtmfTonesResult create(SendDtmfTonesResultInternal internalResponse) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new SendDtmfTonesResult(); + } + + assert accessor != null; + return accessor.create(internalResponse); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java index 713c750cbf937..21e63abc4d7bc 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java @@ -4,10 +4,10 @@ package com.azure.communication.callautomation.implementation.accesshelpers; import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; -import com.azure.communication.callautomation.models.UnmuteParticipantsResult; +import com.azure.communication.callautomation.models.UnmuteParticipantResult; /** - * Helper class to access private values of {@link UnmuteParticipantsResult} across package boundaries. + * Helper class to access private values of {@link UnmuteParticipantResult} across package boundaries. */ public final class UnmuteParticipantsResponseConstructorProxy { private static UnmuteParticipantsResponseConstructorAccessor accessor; @@ -20,17 +20,17 @@ private UnmuteParticipantsResponseConstructorProxy() { } */ public interface UnmuteParticipantsResponseConstructorAccessor { /** - * Creates a new instance of {@link UnmuteParticipantsResult} backed by an internal instance of - * {@link UnmuteParticipantsResult}. + * Creates a new instance of {@link UnmuteParticipantResult} backed by an internal instance of + * {@link UnmuteParticipantsResponseInternal}. * * @param internalResponse The internal response. - * @return A new instance of {@link UnmuteParticipantsResult}. + * @return A new instance of {@link UnmuteParticipantResult}. */ - UnmuteParticipantsResult create(UnmuteParticipantsResponseInternal internalResponse); + UnmuteParticipantResult create(UnmuteParticipantsResponseInternal internalResponse); } /** - * The method called from {@link UnmuteParticipantsResult} to set it's accessor. + * The method called from {@link UnmuteParticipantResult} to set it's accessor. * * @param accessor The accessor. */ @@ -39,18 +39,18 @@ public static void setAccessor(final UnmuteParticipantsResponseConstructorAccess } /** - * Creates a new instance of {@link UnmuteParticipantsResult} backed by an internal instance of - * {@link UnmuteParticipantsResult}. + * Creates a new instance of {@link UnmuteParticipantResult} backed by an internal instance of + * {@link UnmuteParticipantsResponseInternal}. * * @param internalResponse The internal response. - * @return A new instance of {@link UnmuteParticipantsResult}. + * @return A new instance of {@link UnmuteParticipantResult}. */ - public static UnmuteParticipantsResult create(UnmuteParticipantsResponseInternal internalResponse) { + public static UnmuteParticipantResult create(UnmuteParticipantsResponseInternal internalResponse) { // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor // is null this effectively pokes the class to set up the accessor. if (accessor == null) { - new UnmuteParticipantsResult(); + new UnmuteParticipantResult(); } assert accessor != null; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantCancelled.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantCancelled.java deleted file mode 100644 index fd5daec9a5a6f..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantCancelled.java +++ /dev/null @@ -1,175 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Successful cancel add participant event. */ -@Fluent -public final class AddParticipantCancelled { - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId") - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId") - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /* - * Used by customers when calling mid-call actions to correlate the request to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /* - * Participant that has been cancelled. - */ - @JsonProperty(value = "participant") - private CommunicationIdentifierModel participant; - - /* - * Invitation ID used to cancel the request. - */ - @JsonProperty(value = "invitationId") - private String invitationId; - - /** Creates an instance of AddParticipantCancelled class. */ - public AddParticipantCancelled() {} - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Set the callConnectionId property: Call connection ID. - * - * @param callConnectionId the callConnectionId value to set. - * @return the AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setCallConnectionId(String callConnectionId) { - this.callConnectionId = callConnectionId; - return this; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Set the serverCallId property: Server call ID. - * - * @param serverCallId the serverCallId value to set. - * @return the AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setServerCallId(String serverCallId) { - this.serverCallId = serverCallId; - return this; - } - - /** - * 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; - } - - /** - * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @param correlationId the correlationId value to set. - * @return the AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; - } - - /** - * 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; - } - - /** - * 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 AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } - - /** - * Get the participant property: Participant that has been cancelled. - * - * @return the participant value. - */ - public CommunicationIdentifierModel getParticipant() { - return this.participant; - } - - /** - * Set the participant property: Participant that has been cancelled. - * - * @param participant the participant value to set. - * @return the AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setParticipant(CommunicationIdentifierModel participant) { - this.participant = participant; - return this; - } - - /** - * Get the invitationId property: Invitation ID used to cancel the request. - * - * @return the invitationId value. - */ - public String getInvitationId() { - return this.invitationId; - } - - /** - * Set the invitationId property: Invitation ID used to cancel the request. - * - * @param invitationId the invitationId value to set. - * @return the AddParticipantCancelled object itself. - */ - public AddParticipantCancelled setInvitationId(String invitationId) { - this.invitationId = invitationId; - return this; - } -} 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 7a2e81d57f0b9..f72809e5ff404 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,22 +7,21 @@ 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; @@ -41,28 +40,36 @@ 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; /* - * Used by customer to send custom context to targets + * Used by customer to send custom calling context to targets */ - @JsonProperty(value = "customContext") - private CustomContext customContext; + @JsonProperty(value = "customCallingContext") + private CustomCallingContext customCallingContext; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @JsonProperty(value = "operationCallbackUri") + private String operationCallbackUri; /** - * 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. - * + * 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. + * * @return the sourceCallerIdNumber value. */ public PhoneNumberIdentifierModel getSourceCallerIdNumber() { @@ -70,9 +77,10 @@ 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. */ @@ -82,9 +90,10 @@ 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() { @@ -92,9 +101,10 @@ 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. */ @@ -105,7 +115,7 @@ public AddParticipantRequestInternal setSourceDisplayName(String sourceDisplayNa /** * Get the participantToAdd property: The participant to invite. - * + * * @return the participantToAdd value. */ public CommunicationIdentifierModel getParticipantToAdd() { @@ -114,7 +124,7 @@ public CommunicationIdentifierModel getParticipantToAdd() { /** * Set the participantToAdd property: The participant to invite. - * + * * @param participantToAdd the participantToAdd value to set. * @return the AddParticipantRequestInternal object itself. */ @@ -125,8 +135,9 @@ 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() { @@ -135,8 +146,9 @@ 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. */ @@ -148,7 +160,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() { @@ -158,7 +170,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. */ @@ -168,42 +180,48 @@ public AddParticipantRequestInternal setOperationContext(String operationContext } /** - * Get the customContext property: Used by customer to send custom context to targets. - * - * @return the customContext value. + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. */ - public CustomContext getCustomContext() { - return this.customContext; + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; } /** - * Set the customContext property: Used by customer to send custom context to targets. - * - * @param customContext the customContext value to set. + * 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. */ - public AddParticipantRequestInternal setCustomContext(CustomContext customContext) { - this.customContext = customContext; + public AddParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; return this; } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; + * 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. + * + * @return the operationCallbackUri value. + */ + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the AddParticipantRequestInternal object itself. */ - public AddParticipantRequestInternal setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public AddParticipantRequestInternal setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 8f07f98fa8cc3..364ac42c7198b 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,7 +7,9 @@ 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 { /* @@ -28,9 +30,15 @@ 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() { @@ -39,7 +47,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. */ @@ -50,7 +58,7 @@ public AddParticipantResponseInternal setParticipant(CallParticipantInternal par /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -59,7 +67,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. */ @@ -70,7 +78,7 @@ public AddParticipantResponseInternal setOperationContext(String operationContex /** * Get the invitationId property: Invitation ID used to add a participant. - * + * * @return the invitationId value. */ public String getInvitationId() { @@ -79,7 +87,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 36b08abbcc905..361d665d6b46b 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,7 +7,9 @@ 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 { /* @@ -41,20 +43,26 @@ public final class AnswerCallRequestInternal { private TranscriptionConfiguration transcriptionConfiguration; /* - * The endpoint URL of the Azure Cognitive Services resource attached + * AI options for the call. */ - @JsonProperty(value = "azureCognitiveServicesEndpointUrl") - private String azureCognitiveServicesEndpointUrl; + @JsonProperty(value = "callIntelligenceOptions") + private CallIntelligenceOptionsInternal callIntelligenceOptions; /* * The identifier of the call automation entity which answers the call */ - @JsonProperty(value = "answeredByIdentifier") - private CommunicationUserIdentifierModel answeredByIdentifier; + @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() { @@ -63,7 +71,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. */ @@ -74,7 +82,7 @@ public AnswerCallRequestInternal setIncomingCallContext(String incomingCallConte /** * Get the callbackUri property: The callback uri. - * + * * @return the callbackUri value. */ public String getCallbackUri() { @@ -83,7 +91,7 @@ public String getCallbackUri() { /** * Set the callbackUri property: The callback uri. - * + * * @param callbackUri the callbackUri value to set. * @return the AnswerCallRequestInternal object itself. */ @@ -94,7 +102,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() { @@ -103,7 +111,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. */ @@ -114,7 +122,7 @@ public AnswerCallRequestInternal setOperationContext(String operationContext) { /** * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @return the mediaStreamingConfiguration value. */ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { @@ -123,19 +131,19 @@ 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() { @@ -144,55 +152,54 @@ public TranscriptionConfiguration getTranscriptionConfiguration() { /** * 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(TranscriptionConfiguration transcriptionConfiguration) { this.transcriptionConfiguration = transcriptionConfiguration; return this; } /** - * Get the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. - * - * @return the azureCognitiveServicesEndpointUrl value. + * Get the callIntelligenceOptions property: AI options for the call. + * + * @return the callIntelligenceOptions value. */ - public String getAzureCognitiveServicesEndpointUrl() { - return this.azureCognitiveServicesEndpointUrl; + public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { + return this.callIntelligenceOptions; } /** - * Set the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. - * - * @param azureCognitiveServicesEndpointUrl the azureCognitiveServicesEndpointUrl value to set. + * Set the callIntelligenceOptions property: AI options for the call. + * + * @param callIntelligenceOptions the callIntelligenceOptions value to set. * @return the AnswerCallRequestInternal object itself. */ - public AnswerCallRequestInternal setAzureCognitiveServicesEndpointUrl(String azureCognitiveServicesEndpointUrl) { - this.azureCognitiveServicesEndpointUrl = azureCognitiveServicesEndpointUrl; + public AnswerCallRequestInternal + setCallIntelligenceOptions(CallIntelligenceOptionsInternal callIntelligenceOptions) { + this.callIntelligenceOptions = callIntelligenceOptions; return this; } /** - * Get the answeredByIdentifier property: The identifier of the call automation entity which answers the call. - * - * @return the answeredByIdentifier value. + * Get the answeredBy property: The identifier of the call automation entity which answers the call. + * + * @return the answeredBy value. */ - public CommunicationUserIdentifierModel getAnsweredByIdentifier() { - return this.answeredByIdentifier; + public CommunicationUserIdentifierModel getAnsweredBy() { + return this.answeredBy; } /** - * Set the answeredByIdentifier property: The identifier of the call automation entity which answers the call. - * - * @param answeredByIdentifier the answeredByIdentifier value to set. + * 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. */ - public AnswerCallRequestInternal setAnsweredByIdentifier(CommunicationUserIdentifierModel answeredByIdentifier) { - this.answeredByIdentifier = answeredByIdentifier; + public AnswerCallRequestInternal setAnsweredBy(CommunicationUserIdentifierModel answeredBy) { + this.answeredBy = answeredBy; return this; } } 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 new file mode 100644 index 0000000000000..da9e51f34aff8 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java @@ -0,0 +1,33 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * 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; + } +} 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 new file mode 100644 index 0000000000000..4dc385cab8735 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java @@ -0,0 +1,58 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * The BaseDialog model. + */ +@JsonTypeInfo( + 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) }) +@Fluent +public class BaseDialog { + /* + * Dialog context. + */ + @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() { + return this.context; + } + + /** + * Set the context property: Dialog context. + * + * @param context the context value to set. + * @return the BaseDialog object itself. + */ + public BaseDialog setContext(Map context) { + this.context = context; + return this; + } +} 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 1fca59710f5b2..5a51ebbf65c3d 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 e35f46b13e1dc..f29818170680e 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,7 +8,9 @@ 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 { /* @@ -54,8 +56,7 @@ 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") @@ -70,8 +71,8 @@ public final class CallConnectionPropertiesInternal { /* * Source identity. */ - @JsonProperty(value = "sourceIdentity") - private CommunicationIdentifierModel sourceIdentity; + @JsonProperty(value = "source") + private CommunicationIdentifierModel source; /* * The correlation ID. @@ -80,15 +81,20 @@ 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 = "answeredByIdentifier") - private CommunicationUserIdentifierModel answeredByIdentifier; + @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() { @@ -97,7 +103,7 @@ public String getCallConnectionId() { /** * Set the callConnectionId property: The call connection id. - * + * * @param callConnectionId the callConnectionId value to set. * @return the CallConnectionPropertiesInternal object itself. */ @@ -108,7 +114,7 @@ public CallConnectionPropertiesInternal setCallConnectionId(String callConnectio /** * Get the serverCallId property: The server call id. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -117,7 +123,7 @@ public String getServerCallId() { /** * Set the serverCallId property: The server call id. - * + * * @param serverCallId the serverCallId value to set. * @return the CallConnectionPropertiesInternal object itself. */ @@ -128,7 +134,7 @@ public CallConnectionPropertiesInternal setServerCallId(String serverCallId) { /** * Get the targets property: The targets of the call. - * + * * @return the targets value. */ public List getTargets() { @@ -137,7 +143,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. */ @@ -148,7 +154,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. */ @@ -42,7 +67,11 @@ public static CallConnectionStateModelInternal fromString(String name) { return fromString(name, CallConnectionStateModelInternal.class); } - /** @return known CallConnectionStateModelInternal values. */ + /** + * Gets 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/CallIntelligenceOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java new file mode 100644 index 0000000000000..53ec32082eda2 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java @@ -0,0 +1,43 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AI options for the call. */ +@Fluent +public final class CallIntelligenceOptions { + /* + * The identifier of the Cognitive Service resource assigned to this call. + */ + @JsonProperty(value = "cognitiveServicesEndpoint") + private String cognitiveServicesEndpoint; + + /** Creates an instance of CallIntelligenceOptions class. */ + public CallIntelligenceOptions() {} + + /** + * Get the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this + * call. + * + * @return the cognitiveServicesEndpoint value. + */ + public String getCognitiveServicesEndpoint() { + return this.cognitiveServicesEndpoint; + } + + /** + * Set the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this + * call. + * + * @param cognitiveServicesEndpoint the cognitiveServicesEndpoint value to set. + * @return the CallIntelligenceOptions object itself. + */ + public CallIntelligenceOptions setCognitiveServicesEndpoint(String cognitiveServicesEndpoint) { + this.cognitiveServicesEndpoint = cognitiveServicesEndpoint; + return this; + } +} 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 new file mode 100644 index 0000000000000..11bef4b749158 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java @@ -0,0 +1,48 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AI options for the call. + */ +@Fluent +public final class CallIntelligenceOptionsInternal { + /* + * The identifier of the Cognitive Service resource assigned to this call. + */ + @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() { + return this.cognitiveServicesEndpoint; + } + + /** + * 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. + */ + public CallIntelligenceOptionsInternal setCognitiveServicesEndpoint(String cognitiveServicesEndpoint) { + this.cognitiveServicesEndpoint = cognitiveServicesEndpoint; + return this; + } +} 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 847ccfe1bf766..acdf5f8c46eb4 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,7 +7,9 @@ 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 { /* @@ -28,9 +30,15 @@ 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() { @@ -39,7 +47,7 @@ public String getGroupCallId() { /** * Set the groupCallId property: The group call id. - * + * * @param groupCallId the groupCallId value to set. * @return the CallLocatorInternal object itself. */ @@ -50,7 +58,7 @@ public CallLocatorInternal setGroupCallId(String groupCallId) { /** * Get the serverCallId property: The server call id. - * + * * @return the serverCallId value. */ public String getServerCallId() { @@ -59,7 +67,7 @@ public String getServerCallId() { /** * Set the serverCallId property: The server call id. - * + * * @param serverCallId the serverCallId value to set. * @return the CallLocatorInternal object itself. */ @@ -70,7 +78,7 @@ public CallLocatorInternal setServerCallId(String serverCallId) { /** * Get the kind property: The call locator kind. - * + * * @return the kind value. */ public CallLocatorKindInternal getKind() { @@ -79,7 +87,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 5e413597d6186..1d89c642d2b45 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,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CallLocatorKindInternal. */ +/** + * The call locator kind. + */ 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. */ @@ -27,7 +42,11 @@ public static CallLocatorKindInternal fromString(String name) { return fromString(name, CallLocatorKindInternal.class); } - /** @return known CallLocatorKindInternal values. */ + /** + * Gets 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 e71b834d9aaa2..f811a04484258 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Contract model of an ACS call participant. */ +/** + * A call participant. + */ @Fluent public final class CallParticipantInternal { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,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. */ @@ -44,7 +52,7 @@ public CallParticipantInternal setIdentifier(CommunicationIdentifierModel identi /** * Get the isMuted property: Is participant muted. - * + * * @return the isMuted value. */ public Boolean isMuted() { @@ -53,7 +61,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 5cb7dc57aa9eb..fe73b087788c0 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,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CallRejectReasonInternal. */ +/** + * The rejection reason. + */ 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. */ @@ -30,7 +47,11 @@ public static CallRejectReasonInternal fromString(String name) { return fromString(name, CallRejectReasonInternal.class); } - /** @return known CallRejectReasonInternal values. */ + /** + * Gets 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/CancelAddParticipantFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java deleted file mode 100644 index a1372df3710f1..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java +++ /dev/null @@ -1,175 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Failed cancel add participant event. */ -@Fluent -public final class CancelAddParticipantFailed { - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId") - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId") - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /* - * Used by customers when calling mid-call actions to correlate the request to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation") - private ResultInformation resultInformation; - - /* - * Invitation ID used to cancel the request. - */ - @JsonProperty(value = "invitationId") - private String invitationId; - - /** Creates an instance of CancelAddParticipantFailed class. */ - public CancelAddParticipantFailed() {} - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Set the callConnectionId property: Call connection ID. - * - * @param callConnectionId the callConnectionId value to set. - * @return the CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setCallConnectionId(String callConnectionId) { - this.callConnectionId = callConnectionId; - return this; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Set the serverCallId property: Server call ID. - * - * @param serverCallId the serverCallId value to set. - * @return the CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setServerCallId(String serverCallId) { - this.serverCallId = serverCallId; - return this; - } - - /** - * 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; - } - - /** - * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @param correlationId the correlationId value to set. - * @return the CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; - } - - /** - * 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; - } - - /** - * 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 CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } - - /** - * 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; - } - - /** - * Set the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @param resultInformation the resultInformation value to set. - * @return the CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setResultInformation(ResultInformation resultInformation) { - this.resultInformation = resultInformation; - return this; - } - - /** - * Get the invitationId property: Invitation ID used to cancel the request. - * - * @return the invitationId value. - */ - public String getInvitationId() { - return this.invitationId; - } - - /** - * Set the invitationId property: Invitation ID used to cancel the request. - * - * @param invitationId the invitationId value to set. - * @return the CancelAddParticipantFailed object itself. - */ - public CancelAddParticipantFailed setInvitationId(String invitationId) { - this.invitationId = invitationId; - return this; - } -} 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 f8369b2a0ad80..fecbd53b495fd 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The CancelAddParticipantRequest model. */ +/** + * Request payload for cancelling add participant request. + */ @Fluent public final class CancelAddParticipantRequest { /* @@ -17,21 +19,28 @@ 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; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @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() { @@ -40,7 +49,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. */ @@ -52,7 +61,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() { @@ -62,7 +71,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. */ @@ -72,22 +81,28 @@ public CancelAddParticipantRequest setOperationContext(String operationContext) } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the CancelAddParticipantRequest object itself. */ - public CancelAddParticipantRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public CancelAddParticipantRequest setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 b8ab3772975e7..019dac89b0343 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The CancelAddParticipantResponse model. */ +/** + * Response payload for cancel add participant request. + */ @Fluent public final class CancelAddParticipantResponse { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,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. */ @@ -44,7 +52,7 @@ public CancelAddParticipantResponse setInvitationId(String invitationId) { /** * Get the operationContext property: The operation context provided by client. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -53,7 +61,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 b37390bef792a..ec3bf7e858909 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,27 +7,33 @@ 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() { @@ -36,7 +42,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. */ @@ -48,7 +54,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() { @@ -58,7 +64,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 f5a782746b19c..0d3ba4bbdaf80 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ChoiceResultInternal model. */ +/** + * The ChoiceResultInternal model. + */ @Fluent public final class ChoiceResultInternal { /* @@ -18,15 +20,21 @@ 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() { @@ -35,7 +43,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. */ @@ -45,10 +53,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() { @@ -56,10 +64,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 a6a19aa3dd559..59f4b817ad57f 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,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The CollectTonesResultInternal model. */ +/** + * The CollectTonesResultInternal model. + */ @Immutable public final class CollectTonesResultInternal { /* @@ -17,9 +19,15 @@ 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 07a1b2042c1cb..1939287a2d712 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,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CommunicationCloudEnvironmentModel. */ +/** + * The cloud that the identifier belongs to. + */ 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. */ @@ -30,7 +47,11 @@ public static CommunicationCloudEnvironmentModel fromString(String name) { return fromString(name, CommunicationCloudEnvironmentModel.class); } - /** @return known CommunicationCloudEnvironmentModel values. */ + /** + * Gets 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 ee390d3e598f8..ab89c63ae509a 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,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The Communication Services error. */ +/** + * The Communication Services error. + */ @Fluent public final class CommunicationError { /* @@ -41,9 +43,15 @@ 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() { @@ -52,7 +60,7 @@ public String getCode() { /** * Set the code property: The error code. - * + * * @param code the code value to set. * @return the CommunicationError object itself. */ @@ -63,7 +71,7 @@ public CommunicationError setCode(String code) { /** * Get the message property: The error message. - * + * * @return the message value. */ public String getMessage() { @@ -72,7 +80,7 @@ public String getMessage() { /** * Set the message property: The error message. - * + * * @param message the message value to set. * @return the CommunicationError object itself. */ @@ -83,7 +91,7 @@ public CommunicationError setMessage(String message) { /** * Get the target property: The error target. - * + * * @return the target value. */ public String getTarget() { @@ -92,7 +100,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() { @@ -101,7 +109,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 4403b761aa544..3a604646923e9 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 d591a9a16cff8..919c88bc5e90d 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,11 +7,13 @@ 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. */ @@ -21,16 +23,19 @@ 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 4892a9df8e90a..0ba691ca947b6 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,9 +44,15 @@ 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() { @@ -55,7 +61,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. */ @@ -66,7 +72,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() { @@ -75,7 +81,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. */ @@ -86,7 +92,7 @@ public CommunicationIdentifierModel setRawId(String rawId) { /** * Get the communicationUser property: The communication user. - * + * * @return the communicationUser value. */ public CommunicationUserIdentifierModel getCommunicationUser() { @@ -95,7 +101,7 @@ public CommunicationUserIdentifierModel getCommunicationUser() { /** * Set the communicationUser property: The communication user. - * + * * @param communicationUser the communicationUser value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -106,7 +112,7 @@ public CommunicationIdentifierModel setCommunicationUser(CommunicationUserIdenti /** * Get the phoneNumber property: The phone number. - * + * * @return the phoneNumber value. */ public PhoneNumberIdentifierModel getPhoneNumber() { @@ -115,7 +121,7 @@ public PhoneNumberIdentifierModel getPhoneNumber() { /** * Set the phoneNumber property: The phone number. - * + * * @param phoneNumber the phoneNumber value to set. * @return the CommunicationIdentifierModel object itself. */ @@ -126,7 +132,7 @@ public CommunicationIdentifierModel setPhoneNumber(PhoneNumberIdentifierModel ph /** * Get the microsoftTeamsUser property: The Microsoft Teams user. - * + * * @return the microsoftTeamsUser value. */ public MicrosoftTeamsUserIdentifierModel getMicrosoftTeamsUser() { @@ -135,7 +141,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 dd31e3047e264..5f99503d41f1d 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,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CommunicationIdentifierModelKind. */ +/** + * The identifier kind, for example 'communicationUser' or 'phoneNumber'. + */ 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. */ @@ -33,7 +52,11 @@ public static CommunicationIdentifierModelKind fromString(String name) { return fromString(name, CommunicationIdentifierModelKind.class); } - /** @return known CommunicationIdentifierModelKind values. */ + /** + * Gets 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 181bfb121ae41..dbc8b5fcf3dc5 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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/ContinuousDtmfRecognitionRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java deleted file mode 100644 index 572c57959e2eb..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java +++ /dev/null @@ -1,64 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ContinuousDtmfRecognitionRequest model. */ -@Fluent -public final class ContinuousDtmfRecognitionRequest { - /* - * Defines options for recognition. - */ - @JsonProperty(value = "targetParticipant", required = true) - private CommunicationIdentifierModel targetParticipant; - - /* - * The value to identify context of the operation. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the targetParticipant property: Defines options for recognition. - * - * @return the targetParticipant value. - */ - public CommunicationIdentifierModel getTargetParticipant() { - return this.targetParticipant; - } - - /** - * Set the targetParticipant property: Defines options for recognition. - * - * @param targetParticipant the targetParticipant value to set. - * @return the ContinuousDtmfRecognitionRequest object itself. - */ - public ContinuousDtmfRecognitionRequest 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() { - return this.operationContext; - } - - /** - * Set the operationContext property: The value to identify context of the operation. - * - * @param operationContext the operationContext value to set. - * @return the ContinuousDtmfRecognitionRequest object itself. - */ - public ContinuousDtmfRecognitionRequest setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} 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 68a33fd23390c..fcf3a6874f38a 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ContinuousDtmfRecognitionRequestInternal model. */ +/** + * The ContinuousDtmfRecognitionRequestInternal model. + */ @Fluent public final class ContinuousDtmfRecognitionRequestInternal { /* @@ -23,14 +25,22 @@ public final class ContinuousDtmfRecognitionRequestInternal { private String operationContext; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @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() { @@ -39,19 +49,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() { @@ -60,7 +70,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. */ @@ -70,22 +80,28 @@ public ContinuousDtmfRecognitionRequestInternal setOperationContext(String opera } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the ContinuousDtmfRecognitionRequestInternal object itself. */ - public ContinuousDtmfRecognitionRequestInternal setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public ContinuousDtmfRecognitionRequestInternal setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 f02b7180ef965..ec4d10c624542 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,7 +8,9 @@ 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 { /* @@ -18,8 +20,7 @@ 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") @@ -34,8 +35,8 @@ public final class CreateCallRequestInternal { /* * The identifier of the source of the call */ - @JsonProperty(value = "sourceIdentity") - private CommunicationUserIdentifierModel sourceIdentity; + @JsonProperty(value = "source") + private CommunicationUserIdentifierModel source; /* * A customer set value used to track the answering of a call. @@ -62,20 +63,26 @@ public final class CreateCallRequestInternal { private TranscriptionConfiguration transcriptionConfiguration; /* - * The identifier of the Cognitive Service resource assigned to this call. + * AI options for the call. */ - @JsonProperty(value = "azureCognitiveServicesEndpointUrl") - private String azureCognitiveServicesEndpointUrl; + @JsonProperty(value = "callIntelligenceOptions") + private CallIntelligenceOptionsInternal callIntelligenceOptions; /* - * Used by customer to send custom context to targets + * Used by customer to send custom calling context to targets */ - @JsonProperty(value = "customContext") - private CustomContext customContext; + @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() { @@ -84,7 +91,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. */ @@ -94,9 +101,10 @@ 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() { @@ -104,9 +112,10 @@ 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. */ @@ -117,7 +126,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() { @@ -126,7 +135,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. */ @@ -136,28 +145,28 @@ public CreateCallRequestInternal setSourceDisplayName(String sourceDisplayName) } /** - * Get the sourceIdentity property: The identifier of the source of the call. - * - * @return the sourceIdentity value. + * Get the source property: The identifier of the source of the call. + * + * @return the source value. */ - public CommunicationUserIdentifierModel getSourceIdentity() { - return this.sourceIdentity; + public CommunicationUserIdentifierModel getSource() { + return this.source; } /** - * Set the sourceIdentity property: The identifier of the source of the call. - * - * @param sourceIdentity the sourceIdentity value to set. + * Set the source property: The identifier of the source of the call. + * + * @param source the source value to set. * @return the CreateCallRequestInternal object itself. */ - public CreateCallRequestInternal setSourceIdentity(CommunicationUserIdentifierModel sourceIdentity) { - this.sourceIdentity = sourceIdentity; + public CreateCallRequestInternal setSource(CommunicationUserIdentifierModel source) { + this.source = source; return this; } /** * Get the operationContext property: A customer set value used to track the answering of a call. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -166,7 +175,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. */ @@ -177,7 +186,7 @@ public CreateCallRequestInternal setOperationContext(String operationContext) { /** * Get the callbackUri property: The callback URI. - * + * * @return the callbackUri value. */ public String getCallbackUri() { @@ -186,7 +195,7 @@ public String getCallbackUri() { /** * Set the callbackUri property: The callback URI. - * + * * @param callbackUri the callbackUri value to set. * @return the CreateCallRequestInternal object itself. */ @@ -197,7 +206,7 @@ public CreateCallRequestInternal setCallbackUri(String callbackUri) { /** * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * + * * @return the mediaStreamingConfiguration value. */ public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { @@ -206,19 +215,19 @@ 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() { @@ -227,55 +236,54 @@ public TranscriptionConfiguration getTranscriptionConfiguration() { /** * 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(TranscriptionConfiguration transcriptionConfiguration) { this.transcriptionConfiguration = transcriptionConfiguration; return this; } /** - * Get the azureCognitiveServicesEndpointUrl property: The identifier of the Cognitive Service resource assigned to - * this call. - * - * @return the azureCognitiveServicesEndpointUrl value. + * Get the callIntelligenceOptions property: AI options for the call. + * + * @return the callIntelligenceOptions value. */ - public String getAzureCognitiveServicesEndpointUrl() { - return this.azureCognitiveServicesEndpointUrl; + public CallIntelligenceOptionsInternal getCallIntelligenceOptions() { + return this.callIntelligenceOptions; } /** - * Set the azureCognitiveServicesEndpointUrl property: The identifier of the Cognitive Service resource assigned to - * this call. - * - * @param azureCognitiveServicesEndpointUrl the azureCognitiveServicesEndpointUrl value to set. + * Set the callIntelligenceOptions property: AI options for the call. + * + * @param callIntelligenceOptions the callIntelligenceOptions value to set. * @return the CreateCallRequestInternal object itself. */ - public CreateCallRequestInternal setAzureCognitiveServicesEndpointUrl(String azureCognitiveServicesEndpointUrl) { - this.azureCognitiveServicesEndpointUrl = azureCognitiveServicesEndpointUrl; + public CreateCallRequestInternal + setCallIntelligenceOptions(CallIntelligenceOptionsInternal callIntelligenceOptions) { + this.callIntelligenceOptions = callIntelligenceOptions; return this; } /** - * Get the customContext property: Used by customer to send custom context to targets. - * - * @return the customContext value. + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. */ - public CustomContext getCustomContext() { - return this.customContext; + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; } /** - * Set the customContext property: Used by customer to send custom context to targets. - * - * @param customContext the customContext value to set. + * 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. */ - public CreateCallRequestInternal setCustomContext(CustomContext customContext) { - this.customContext = customContext; + public CreateCallRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; return this; } } 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 new file mode 100644 index 0000000000000..1d6660d121d83 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java @@ -0,0 +1,73 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The CustomCallingContext model. + */ +@Fluent +public final class CustomCallingContext { + /* + * Dictionary of + */ + @JsonProperty(value = "voipHeaders") + private Map voipHeaders; + + /* + * Dictionary of + */ + @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() { + return this.voipHeaders; + } + + /** + * Set the voipHeaders property: Dictionary of <string>. + * + * @param voipHeaders the voipHeaders value to set. + * @return the CustomCallingContext object itself. + */ + public CustomCallingContext setVoipHeaders(Map voipHeaders) { + this.voipHeaders = voipHeaders; + return this; + } + + /** + * Get the sipHeaders property: Dictionary of <string>. + * + * @return the sipHeaders value. + */ + public Map getSipHeaders() { + return this.sipHeaders; + } + + /** + * Set the sipHeaders property: Dictionary of <string>. + * + * @param sipHeaders the sipHeaders value to set. + * @return the CustomCallingContext object itself. + */ + public CustomCallingContext setSipHeaders(Map sipHeaders) { + this.sipHeaders = sipHeaders; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java index 241ce41847243..3dbbc0d03c537 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java @@ -23,6 +23,9 @@ public final class CustomContext { @JsonProperty(value = "sipHeaders") private Map sipHeaders; + /** Creates an instance of CustomContext class. */ + public CustomContext() {} + /** * Get the voipHeaders property: Dictionary of <string>. * 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 d97b6fe7408bf..fa0e038edf8a8 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,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DialogInputType. */ +/** + * Determines the type of the dialog. + */ 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. */ @@ -27,7 +42,11 @@ public static DialogInputType fromString(String name) { return fromString(name, DialogInputType.class); } - /** @return known DialogInputType values. */ + /** + * Gets 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/DialogOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogOptions.java deleted file mode 100644 index 72212d5c1f32b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogOptions.java +++ /dev/null @@ -1,65 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The DialogOptions model. */ -@Fluent -public final class DialogOptions { - /* - * Bot identifier. - */ - @JsonProperty(value = "botAppId") - private String botAppId; - - /* - * Dialog context. - */ - @JsonProperty(value = "dialogContext", required = true) - private Map dialogContext; - - /** - * Get the botAppId property: Bot identifier. - * - * @return the botAppId value. - */ - public String getBotAppId() { - return this.botAppId; - } - - /** - * Set the botAppId property: Bot identifier. - * - * @param botAppId the botAppId value to set. - * @return the DialogOptions object itself. - */ - public DialogOptions setBotAppId(String botAppId) { - this.botAppId = botAppId; - return this; - } - - /** - * Get the dialogContext property: Dialog context. - * - * @return the dialogContext value. - */ - public Map getDialogContext() { - return this.dialogContext; - } - - /** - * Set the dialogContext property: Dialog context. - * - * @param dialogContext the dialogContext value to set. - * @return the DialogOptions object itself. - */ - public DialogOptions setDialogContext(Map dialogContext) { - this.dialogContext = dialogContext; - return this; - } -} 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 ca73d055e82f9..24f583411b747 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The DialogStateResponse model. */ +/** + * The DialogStateResponse model. + */ @Fluent public final class DialogStateResponse { /* @@ -17,16 +19,10 @@ public final class DialogStateResponse { private String dialogId; /* - * Defines options for dialog. + * Defines dialog. */ - @JsonProperty(value = "dialogOptions") - private DialogOptions dialogOptions; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; + @JsonProperty(value = "dialog") + private BaseDialog dialog; /* * The value to identify context of the operation. @@ -34,9 +30,15 @@ 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() { @@ -45,7 +47,7 @@ public String getDialogId() { /** * Set the dialogId property: The dialog ID. - * + * * @param dialogId the dialogId value to set. * @return the DialogStateResponse object itself. */ @@ -55,48 +57,28 @@ public DialogStateResponse setDialogId(String dialogId) { } /** - * Get the dialogOptions property: Defines options for dialog. - * - * @return the dialogOptions value. - */ - public DialogOptions getDialogOptions() { - return this.dialogOptions; - } - - /** - * Set the dialogOptions property: Defines options for dialog. - * - * @param dialogOptions the dialogOptions value to set. - * @return the DialogStateResponse object itself. - */ - public DialogStateResponse setDialogOptions(DialogOptions dialogOptions) { - this.dialogOptions = dialogOptions; - return this; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. + * Get the dialog property: Defines dialog. + * + * @return the dialog value. */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; + public BaseDialog getDialog() { + return this.dialog; } /** - * Set the dialogInputType property: Determines the type of the dialog. - * - * @param dialogInputType the dialogInputType value to set. + * Set the dialog property: Defines dialog. + * + * @param dialog the dialog value to set. * @return the DialogStateResponse object itself. */ - public DialogStateResponse setDialogInputType(DialogInputType dialogInputType) { - this.dialogInputType = dialogInputType; + public DialogStateResponse setDialog(BaseDialog dialog) { + this.dialog = dialog; return this; } /** * Get the operationContext property: The value to identify context of the operation. - * + * * @return the operationContext value. */ public String getOperationContext() { @@ -105,7 +87,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 afe9020e401ad..e3be37a00e8d8 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,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Options for DTMF recognition. */ +/** + * Options for DTMF recognition. + */ @Fluent public final class DtmfOptionsInternal { /* @@ -29,9 +31,15 @@ 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() { @@ -40,7 +48,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. */ @@ -51,7 +59,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() { @@ -60,7 +68,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. */ @@ -71,7 +79,7 @@ public DtmfOptionsInternal setMaxTonesToCollect(Integer maxTonesToCollect) { /** * Get the stopTones property: List of tones that will stop recognizing. - * + * * @return the stopTones value. */ public List getStopTones() { @@ -80,7 +88,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 9c9a60a1a8fa5..cbcd130d7336c 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,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The DtmfResult model. */ +/** + * The DtmfResult model. + */ @Immutable public final class DtmfResult { /* @@ -17,9 +19,15 @@ 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 a948acb7be8b7..6890aba1ea99b 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,59 +8,102 @@ 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. */ @@ -69,7 +112,11 @@ public static DtmfToneInternal fromString(String name) { return fromString(name, DtmfToneInternal.class); } - /** @return known DtmfToneInternal values. */ + /** + * Gets 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 da8b5480e1d6e..eea244c9fd018 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ExternalStorageInternal model. */ +/** + * The ExternalStorageInternal model. + */ @Fluent public final class ExternalStorageInternal { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,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. */ @@ -44,7 +52,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() { @@ -53,7 +61,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 e59e9464a3b20..1393f553751a6 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The FileSourceInternal model. */ +/** + * The FileSourceInternal model. + */ @Fluent public final class FileSourceInternal { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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/GenderTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GenderTypeInternal.java deleted file mode 100644 index 9ce654a1eed0a..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GenderTypeInternal.java +++ /dev/null @@ -1,34 +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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GenderTypeInternal. */ -public final class GenderTypeInternal extends ExpandableStringEnum { - /** Static value male for GenderTypeInternal. */ - public static final GenderTypeInternal MALE = fromString("male"); - - /** Static value female for GenderTypeInternal. */ - public static final GenderTypeInternal FEMALE = fromString("female"); - - /** - * Creates or finds a GenderTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding GenderTypeInternal. - */ - @JsonCreator - public static GenderTypeInternal fromString(String name) { - return fromString(name, GenderTypeInternal.class); - } - - /** @return known GenderTypeInternal values. */ - public static Collection values() { - return values(GenderTypeInternal.class); - } -} 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 de6baf3a71c9d..d46f7c71efa65 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,14 +8,16 @@ 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 { /* * List of the current participants in the call. */ - @JsonProperty(value = "values") - private List values; + @JsonProperty(value = "value", required = true) + private List value; /* * Continue of the list of participants @@ -24,28 +26,34 @@ public final class GetParticipantsResponseInternal { private String nextLink; /** - * Get the values property: List of the current participants in the call. - * - * @return the values value. + * Creates an instance of GetParticipantsResponseInternal class. */ - public List getValues() { - return this.values; + public GetParticipantsResponseInternal() { } /** - * Set the values property: List of the current participants in the call. - * - * @param values the values value to set. + * Get the value property: List of the current participants in the call. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: List of the current participants in the call. + * + * @param value the value value to set. * @return the GetParticipantsResponseInternal object itself. */ - public GetParticipantsResponseInternal setValues(List values) { - this.values = values; + public GetParticipantsResponseInternal setValue(List value) { + this.value = value; return this; } /** * Get the nextLink property: Continue of the list of participants. - * + * * @return the nextLink value. */ public String getNextLink() { @@ -54,7 +62,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/Hangup.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/Hangup.java deleted file mode 100644 index 47a039e0ae782..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/Hangup.java +++ /dev/null @@ -1,38 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Hangup model. */ -@Fluent -public final class Hangup { - /* - * The reason property. - */ - @JsonProperty(value = "reason") - private String reason; - - /** - * Get the reason property: The reason property. - * - * @return the reason value. - */ - public String getReason() { - return this.reason; - } - - /** - * Set the reason property: The reason property. - * - * @param reason the reason value to set. - * @return the Hangup object itself. - */ - public Hangup setReason(String reason) { - this.reason = reason; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantRequestInternal.java deleted file mode 100644 index bcb1df7180a29..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantRequestInternal.java +++ /dev/null @@ -1,119 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The request payload for holding participant from the call. */ -@Fluent -public final class HoldParticipantRequestInternal { - /* - * Participant to be held from the call. - */ - @JsonProperty(value = "participantToHold", required = true) - private CommunicationIdentifierModel participantToHold; - - /* - * Prompt to play while in hold. - */ - @JsonProperty(value = "playSourceInfo", required = true) - private PlaySourceInternal playSourceInfo; - - /* - * If the prompt will be looped or not. - */ - @JsonProperty(value = "loop") - private Boolean loop; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the participantToHold property: Participant to be held from the call. - * - * @return the participantToHold value. - */ - public CommunicationIdentifierModel getParticipantToHold() { - return this.participantToHold; - } - - /** - * Set the participantToHold property: Participant to be held from the call. - * - * @param participantToHold the participantToHold value to set. - * @return the HoldParticipantRequestInternal object itself. - */ - public HoldParticipantRequestInternal setParticipantToHold(CommunicationIdentifierModel participantToHold) { - this.participantToHold = participantToHold; - return this; - } - - /** - * Get the playSourceInfo property: Prompt to play while in hold. - * - * @return the playSourceInfo value. - */ - public PlaySourceInternal getPlaySourceInfo() { - return this.playSourceInfo; - } - - /** - * Set the playSourceInfo property: Prompt to play while in hold. - * - * @param playSourceInfo the playSourceInfo value to set. - * @return the HoldParticipantRequestInternal object itself. - */ - public HoldParticipantRequestInternal setPlaySourceInfo(PlaySourceInternal playSourceInfo) { - this.playSourceInfo = playSourceInfo; - return this; - } - - /** - * Get the loop property: If the prompt will be looped or not. - * - * @return the loop value. - */ - public Boolean isLoop() { - return this.loop; - } - - /** - * Set the loop property: If the prompt will be looped or not. - * - * @param loop the loop value to set. - * @return the HoldParticipantRequestInternal object itself. - */ - public HoldParticipantRequestInternal setLoop(Boolean loop) { - this.loop = loop; - return this; - } - - /** - * 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; - } - - /** - * 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 HoldParticipantRequestInternal object itself. - */ - public HoldParticipantRequestInternal setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} 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 f953410cea3b7..18be50f3a5f64 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,18 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for MediaStreamingAudioChannelTypeInternal. */ +/** + * Audio channel type to stream, eg. unmixed audio, mixed audio. + */ 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. */ @@ -28,7 +43,11 @@ public static MediaStreamingAudioChannelTypeInternal fromString(String name) { return fromString(name, MediaStreamingAudioChannelTypeInternal.class); } - /** @return known MediaStreamingAudioChannelTypeInternal values. */ + /** + * Gets 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 54956c4119315..8c57847ad0994 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,7 +7,9 @@ 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 { /* @@ -34,9 +36,15 @@ 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() { @@ -45,7 +53,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. */ @@ -56,7 +64,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() { @@ -65,7 +73,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. */ @@ -76,7 +84,7 @@ public MediaStreamingConfigurationInternal setTransportType(MediaStreamingTransp /** * Get the contentType property: Content type to stream, eg. audio, audio/video. - * + * * @return the contentType value. */ public MediaStreamingContentTypeInternal getContentType() { @@ -85,7 +93,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. */ @@ -96,7 +104,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() { @@ -105,12 +113,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 1554ea125e581..8f4a8b549571c 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,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for MediaStreamingContentTypeInternal. */ +/** + * Content type to stream, eg. audio, audio/video. + */ 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. */ @@ -24,7 +37,11 @@ public static MediaStreamingContentTypeInternal fromString(String name) { return fromString(name, MediaStreamingContentTypeInternal.class); } - /** @return known MediaStreamingContentTypeInternal values. */ + /** + * Gets 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 4bad8f6a8d5ca..4b1af17c27534 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,15 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for MediaStreamingTransportTypeInternal. */ +/** + * The type of transport to be used for media streaming, eg. Websocket. + */ 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. */ @@ -25,7 +38,11 @@ public static MediaStreamingTransportTypeInternal fromString(String name) { return fromString(name, MediaStreamingTransportTypeInternal.class); } - /** @return known MediaStreamingTransportTypeInternal values. */ + /** + * Gets 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 3ae62106d1a72..0ec4fb456bbc0 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,34 +7,39 @@ 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() { @@ -44,7 +49,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. */ @@ -55,7 +60,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() { @@ -64,7 +69,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. */ @@ -75,7 +80,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() { @@ -84,7 +89,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 3fbc9406dee8f..76ce2d226c62d 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,7 +8,9 @@ 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 { /* @@ -19,15 +21,21 @@ 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; /** - * Get the targetParticipants property: Participants to be muted from the call. Only ACS Users are supported. - * + * Creates an instance of MuteParticipantsRequestInternal class. + */ + public MuteParticipantsRequestInternal() { + } + + /** + * Get the targetParticipants property: Participants to be muted from the call. + * Only ACS Users are supported. + * * @return the targetParticipants value. */ public List getTargetParticipants() { @@ -35,13 +43,14 @@ 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; } @@ -49,7 +58,7 @@ public MuteParticipantsRequestInternal setTargetParticipants( /** * 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() { @@ -59,7 +68,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/MuteParticipantsResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java deleted file mode 100644 index 2832adb0924ad..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java +++ /dev/null @@ -1,38 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The response payload for muting participants from the call. */ -@Fluent -public final class MuteParticipantsResponseInternal { - /* - * The operation context provided by client. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the operationContext property: The operation context provided by client. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: The operation context provided by client. - * - * @param operationContext the operationContext value to set. - * @return the MuteParticipantsResponseInternal object itself. - */ - public MuteParticipantsResponseInternal setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java similarity index 69% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantResponseInternal.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java index 69520eb15f221..bd40099aa64dc 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java @@ -7,18 +7,26 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The response payload for unmuting participants from the call. */ +/** + * The result payload for muting participants from the call. + */ @Fluent -public final class UnholdParticipantResponseInternal { +public final class MuteParticipantsResultInternal { /* * The operation context provided by client. */ @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() { @@ -27,11 +35,11 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. - * @return the UnholdParticipantResponseInternal object itself. + * @return the MuteParticipantsResultInternal object itself. */ - public UnholdParticipantResponseInternal setOperationContext(String operationContext) { + public MuteParticipantsResultInternal setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } 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 29e7e249daa50..0e6e5482a869d 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** A phone number. */ +/** + * A phone number. + */ @Fluent public final class PhoneNumberIdentifierModel { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 60b1f526769e9..9ebf0115fd407 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The PlayOptionsInternal model. */ +/** + * The PlayOptionsInternal model. + */ @Fluent public final class PlayOptionsInternal { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 07ec464b3710b..59e89b8baf1ae 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,14 +8,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The PlayRequest model. */ +/** + * The PlayRequest model. + */ @Fluent public final class PlayRequest { /* * The source of the audio to be played. */ - @JsonProperty(value = "playSourceInfo", required = true) - private PlaySourceInternal playSourceInfo; + @JsonProperty(value = "playSources", required = true) + private List playSources; /* * The list of call participants play provided audio to. @@ -37,35 +39,43 @@ public final class PlayRequest { private String operationContext; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @JsonProperty(value = "operationCallbackUri") + private String operationCallbackUri; /** - * Get the playSourceInfo property: The source of the audio to be played. - * - * @return the playSourceInfo value. + * Creates an instance of PlayRequest class. */ - public PlaySourceInternal getPlaySourceInfo() { - return this.playSourceInfo; + public PlayRequest() { } /** - * Set the playSourceInfo property: The source of the audio to be played. - * - * @param playSourceInfo the playSourceInfo value to set. + * Get the playSources property: The source of the audio to be played. + * + * @return the playSources value. + */ + public List getPlaySources() { + return this.playSources; + } + + /** + * Set the playSources property: The source of the audio to be played. + * + * @param playSources the playSources value to set. * @return the PlayRequest object itself. */ - public PlayRequest setPlaySourceInfo(PlaySourceInternal playSourceInfo) { - this.playSourceInfo = playSourceInfo; + public PlayRequest setPlaySources(List playSources) { + this.playSources = playSources; return this; } /** - * 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() { @@ -73,9 +83,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. */ @@ -86,7 +96,7 @@ public PlayRequest setPlayTo(List playTo) { /** * Get the playOptions property: Defines options for playing the audio. - * + * * @return the playOptions value. */ public PlayOptionsInternal getPlayOptions() { @@ -95,7 +105,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. */ @@ -106,7 +116,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() { @@ -115,7 +125,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. */ @@ -125,22 +135,28 @@ public PlayRequest setOperationContext(String operationContext) { } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the PlayRequest object itself. */ - public PlayRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public PlayRequest setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 442d7f81b8eae..4fa917e2c03cd 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,137 +7,144 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The PlaySourceInternal model. */ +/** + * The PlaySourceInternal model. + */ @Fluent public final class PlaySourceInternal { /* * Defines the type of the play source */ - @JsonProperty(value = "sourceType", required = true) - private PlaySourceTypeInternal sourceType; + @JsonProperty(value = "kind", required = true) + private PlaySourceTypeInternal kind; /* * Defines the identifier to be used for caching related media */ - @JsonProperty(value = "playSourceId") - private String playSourceId; + @JsonProperty(value = "playSourceCacheId") + private String playSourceCacheId; /* * Defines the file source info to be used for play */ - @JsonProperty(value = "fileSource") - private FileSourceInternal fileSource; + @JsonProperty(value = "file") + private FileSourceInternal file; /* * Defines the text source info to be used for play */ - @JsonProperty(value = "textSource") - private TextSourceInternal textSource; + @JsonProperty(value = "text") + 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 = "ssmlSource") - private SsmlSourceInternal ssmlSource; + @JsonProperty(value = "ssml") + private SsmlSourceInternal ssml; /** - * Get the sourceType property: Defines the type of the play source. - * - * @return the sourceType value. + * Creates an instance of PlaySourceInternal class. */ - public PlaySourceTypeInternal getSourceType() { - return this.sourceType; + public PlaySourceInternal() { } /** - * Set the sourceType property: Defines the type of the play source. - * - * @param sourceType the sourceType value to set. + * Get the kind property: Defines the type of the play source. + * + * @return the kind value. + */ + public PlaySourceTypeInternal getKind() { + return this.kind; + } + + /** + * Set the kind property: Defines the type of the play source. + * + * @param kind the kind value to set. * @return the PlaySourceInternal object itself. */ - public PlaySourceInternal setSourceType(PlaySourceTypeInternal sourceType) { - this.sourceType = sourceType; + public PlaySourceInternal setKind(PlaySourceTypeInternal kind) { + this.kind = kind; return this; } /** - * Get the playSourceId property: Defines the identifier to be used for caching related media. - * - * @return the playSourceId value. + * Get the playSourceCacheId property: Defines the identifier to be used for caching related media. + * + * @return the playSourceCacheId value. */ - public String getPlaySourceId() { - return this.playSourceId; + public String getPlaySourceCacheId() { + return this.playSourceCacheId; } /** - * Set the playSourceId property: Defines the identifier to be used for caching related media. - * - * @param playSourceId the playSourceId value to set. + * 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. */ - public PlaySourceInternal setPlaySourceId(String playSourceId) { - this.playSourceId = playSourceId; + public PlaySourceInternal setPlaySourceCacheId(String playSourceCacheId) { + this.playSourceCacheId = playSourceCacheId; return this; } /** - * Get the fileSource property: Defines the file source info to be used for play. - * - * @return the fileSource value. + * Get the file property: Defines the file source info to be used for play. + * + * @return the file value. */ - public FileSourceInternal getFileSource() { - return this.fileSource; + public FileSourceInternal getFile() { + return this.file; } /** - * Set the fileSource property: Defines the file source info to be used for play. - * - * @param fileSource the fileSource value to set. + * 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. */ - public PlaySourceInternal setFileSource(FileSourceInternal fileSource) { - this.fileSource = fileSource; + public PlaySourceInternal setFile(FileSourceInternal file) { + this.file = file; return this; } /** - * Get the textSource property: Defines the text source info to be used for play. - * - * @return the textSource value. + * Get the text property: Defines the text source info to be used for play. + * + * @return the text value. */ - public TextSourceInternal getTextSource() { - return this.textSource; + public TextSourceInternal getText() { + return this.text; } /** - * Set the textSource property: Defines the text source info to be used for play. - * - * @param textSource the textSource value to set. + * 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. */ - public PlaySourceInternal setTextSource(TextSourceInternal textSource) { - this.textSource = textSource; + public PlaySourceInternal setText(TextSourceInternal text) { + this.text = text; return this; } /** - * Get the ssmlSource property: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. - * - * @return the ssmlSource value. + * Get the ssml property: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. + * + * @return the ssml value. */ - public SsmlSourceInternal getSsmlSource() { - return this.ssmlSource; + public SsmlSourceInternal getSsml() { + return this.ssml; } /** - * Set the ssmlSource property: Defines the ssml(Speech Synthesis Markup Language) source info to be used for play. - * - * @param ssmlSource the ssmlSource value to set. + * 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. */ - public PlaySourceInternal setSsmlSource(SsmlSourceInternal ssmlSource) { - this.ssmlSource = ssmlSource; + public PlaySourceInternal setSsml(SsmlSourceInternal ssml) { + this.ssml = ssml; return this; } } 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 e94d5afd03203..69e9b3b6c050b 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,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PlaySourceTypeInternal. */ +/** + * Defines the type of the play source. + */ 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. */ @@ -30,7 +47,11 @@ public static PlaySourceTypeInternal fromString(String name) { return fromString(name, PlaySourceTypeInternal.class); } - /** @return known PlaySourceTypeInternal values. */ + /** + * Gets 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 new file mode 100644 index 0000000000000..813b78b1043c8 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java @@ -0,0 +1,86 @@ +// 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.Fluent; +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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("PowerVirtualAgents") +@Fluent +public final class PowerVirtualAgentsDialog extends BaseDialog { + /* + * Bot identifier. + */ + @JsonProperty(value = "botAppId", required = true) + private String botAppId; + + /* + * Language. + */ + @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() { + return this.botAppId; + } + + /** + * Set the botAppId property: Bot identifier. + * + * @param botAppId the botAppId value to set. + * @return the PowerVirtualAgentsDialog object itself. + */ + public PowerVirtualAgentsDialog setBotAppId(String botAppId) { + this.botAppId = botAppId; + return this; + } + + /** + * Get the language property: Language. + * + * @return the language value. + */ + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: Language. + * + * @param language the language value to set. + * @return the PowerVirtualAgentsDialog object itself. + */ + 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/RecognizeChoiceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java similarity index 73% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeChoiceInternal.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java index db39ef250e1fe..a8f280e95c2c5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeChoiceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java @@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The RecognizeChoiceInternal model. */ +/** + * The RecognitionChoiceInternal model. + */ @Fluent -public final class RecognizeChoiceInternal { +public final class RecognitionChoiceInternal { /* * Identifier for a given choice */ @@ -29,9 +31,15 @@ public final class RecognizeChoiceInternal { @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() { @@ -40,18 +48,18 @@ public String getLabel() { /** * Set the label property: Identifier for a given choice. - * + * * @param label the label value to set. - * @return the RecognizeChoiceInternal object itself. + * @return the RecognitionChoiceInternal object itself. */ - public RecognizeChoiceInternal setLabel(String label) { + public RecognitionChoiceInternal setLabel(String label) { this.label = label; return this; } /** * Get the phrases property: List of phrases to recognize. - * + * * @return the phrases value. */ public List getPhrases() { @@ -60,18 +68,18 @@ public List getPhrases() { /** * Set the phrases property: List of phrases to recognize. - * + * * @param phrases the phrases value to set. - * @return the RecognizeChoiceInternal object itself. + * @return the RecognitionChoiceInternal object itself. */ - public RecognizeChoiceInternal setPhrases(List phrases) { + public RecognitionChoiceInternal setPhrases(List phrases) { this.phrases = phrases; return this; } /** * Get the tone property: The tone property. - * + * * @return the tone value. */ public DtmfToneInternal getTone() { @@ -80,11 +88,11 @@ public DtmfToneInternal getTone() { /** * Set the tone property: The tone property. - * + * * @param tone the tone value to set. - * @return the RecognizeChoiceInternal object itself. + * @return the RecognitionChoiceInternal object itself. */ - public RecognizeChoiceInternal setTone(DtmfToneInternal tone) { + public RecognitionChoiceInternal setTone(DtmfToneInternal tone) { this.tone = tone; return this; } 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 cc38c2393bf33..e555a1bdf52da 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,20 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecognitionTypeInternal. */ +/** + * Determines the sub-type of the recognize operation. + * In case of cancel operation the this field is not set and is returned empty. + */ 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. */ @@ -30,7 +48,11 @@ public static RecognitionTypeInternal fromString(String name) { return fromString(name, RecognitionTypeInternal.class); } - /** @return known RecognitionTypeInternal values. */ + /** + * Gets 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 9ec0961787ef5..a6ae0ecb3b2bc 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,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecognizeInputTypeInternal. */ +/** + * Determines the type of the recognition. + */ 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. */ @@ -33,7 +52,11 @@ public static RecognizeInputTypeInternal fromString(String name) { return fromString(name, RecognizeInputTypeInternal.class); } - /** @return known RecognizeInputTypeInternal values. */ + /** + * Gets 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 8b42ce2af700d..e40542be2e740 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,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The RecognizeOptionsInternal model. */ +/** + * The RecognizeOptionsInternal model. + */ @Fluent public final class RecognizeOptionsInternal { /* @@ -51,7 +53,7 @@ public final class RecognizeOptionsInternal { * Defines Ivr choices for recognize. */ @JsonProperty(value = "choices") - private List choices; + private List choices; /* * Defines continuous speech recognition option. @@ -59,9 +61,15 @@ 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() { @@ -70,7 +78,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. */ @@ -81,7 +89,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() { @@ -90,7 +98,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. */ @@ -101,7 +109,7 @@ public RecognizeOptionsInternal setInitialSilenceTimeoutInSeconds(Integer initia /** * Get the targetParticipant property: Target participant of DTMF tone recognition. - * + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -110,7 +118,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. */ @@ -121,7 +129,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() { @@ -130,7 +138,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. */ @@ -141,7 +149,7 @@ public RecognizeOptionsInternal setSpeechLanguage(String speechLanguage) { /** * Get the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. - * + * * @return the speechRecognitionModelEndpointId value. */ public String getSpeechRecognitionModelEndpointId() { @@ -150,7 +158,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. */ @@ -161,7 +169,7 @@ public RecognizeOptionsInternal setSpeechRecognitionModelEndpointId(String speec /** * Get the dtmfOptions property: Defines configurations for DTMF. - * + * * @return the dtmfOptions value. */ public DtmfOptionsInternal getDtmfOptions() { @@ -170,7 +178,7 @@ public DtmfOptionsInternal getDtmfOptions() { /** * Set the dtmfOptions property: Defines configurations for DTMF. - * + * * @param dtmfOptions the dtmfOptions value to set. * @return the RecognizeOptionsInternal object itself. */ @@ -181,27 +189,27 @@ public RecognizeOptionsInternal setDtmfOptions(DtmfOptionsInternal dtmfOptions) /** * Get the choices property: Defines Ivr choices for recognize. - * + * * @return the choices value. */ - public List getChoices() { + public List getChoices() { return this.choices; } /** * Set the choices property: Defines Ivr choices for recognize. - * + * * @param choices the choices value to set. * @return the RecognizeOptionsInternal object itself. */ - public RecognizeOptionsInternal setChoices(List choices) { + public RecognizeOptionsInternal setChoices(List choices) { this.choices = choices; return this; } /** * Get the speechOptions property: Defines continuous speech recognition option. - * + * * @return the speechOptions value. */ public SpeechOptionsInternal getSpeechOptions() { @@ -210,7 +218,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 046d55ba7f554..3886e69a20516 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The RecognizeRequest model. */ +/** + * The RecognizeRequest model. + */ @Fluent public final class RecognizeRequest { /* @@ -23,8 +25,7 @@ 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; @@ -42,14 +43,22 @@ public final class RecognizeRequest { private String operationContext; /* - * The callback URI to override the main callback URI. + * 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. */ - @JsonProperty(value = "callbackUri") - private String callbackUri; + public RecognizeRequest() { + } /** * Get the recognizeInputType property: Determines the type of the recognition. - * + * * @return the recognizeInputType value. */ public RecognizeInputTypeInternal getRecognizeInputType() { @@ -58,7 +67,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. */ @@ -69,7 +78,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() { @@ -78,7 +87,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. */ @@ -90,7 +99,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() { @@ -100,7 +109,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. */ @@ -111,7 +120,7 @@ public RecognizeRequest setInterruptCallMediaOperation(Boolean interruptCallMedi /** * Get the recognizeOptions property: Defines options for recognition. - * + * * @return the recognizeOptions value. */ public RecognizeOptionsInternal getRecognizeOptions() { @@ -120,7 +129,7 @@ public RecognizeOptionsInternal getRecognizeOptions() { /** * Set the recognizeOptions property: Defines options for recognition. - * + * * @param recognizeOptions the recognizeOptions value to set. * @return the RecognizeRequest object itself. */ @@ -131,7 +140,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() { @@ -140,7 +149,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. */ @@ -150,22 +159,28 @@ public RecognizeRequest setOperationContext(String operationContext) { } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; + * 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. + * + * @return the operationCallbackUri value. + */ + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the RecognizeRequest object itself. */ - public RecognizeRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public RecognizeRequest setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 7bc685488a2a5..ae6e4efafaea7 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,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingChannelInternal. */ +/** + * The channel type of call recording. + */ 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. */ @@ -27,7 +42,11 @@ public static RecordingChannelInternal fromString(String name) { return fromString(name, RecordingChannelInternal.class); } - /** @return known RecordingChannelInternal values. */ + /** + * Gets 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 929ba38b8cffc..e217adf395b7d 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,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingContentInternal. */ +/** + * The content type of call recording. + */ 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. */ @@ -27,7 +42,11 @@ public static RecordingContentInternal fromString(String name) { return fromString(name, RecordingContentInternal.class); } - /** @return known RecordingContentInternal values. */ + /** + * Gets 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 9bb0859bafbea..b0e74cd26d180 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,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingFormatInternal. */ +/** + * The format type of call recording. + */ 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. */ @@ -30,7 +47,11 @@ public static RecordingFormatInternal fromString(String name) { return fromString(name, RecordingFormatInternal.class); } - /** @return known RecordingFormatInternal values. */ + /** + * Gets 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 0e87ac073cf63..edb72ca7c9526 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,17 +8,32 @@ 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. */ @@ -27,7 +42,11 @@ public static RecordingStateInternal fromString(String name) { return fromString(name, RecordingStateInternal.class); } - /** @return known RecordingStateInternal values. */ + /** + * Gets 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 5aa4c7cc30a58..ea2b47ffd0f39 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The RecordingStateResponseInternal model. */ +/** + * The RecordingStateResponseInternal model. + */ @Fluent public final class RecordingStateResponseInternal { /* @@ -28,9 +30,15 @@ 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() { @@ -39,7 +47,7 @@ public String getRecordingId() { /** * Set the recordingId property: The recordingId property. - * + * * @param recordingId the recordingId value to set. * @return the RecordingStateResponseInternal object itself. */ @@ -50,7 +58,7 @@ public RecordingStateResponseInternal setRecordingId(String recordingId) { /** * Get the recordingState property: The recordingState property. - * + * * @return the recordingState value. */ public RecordingStateInternal getRecordingState() { @@ -59,7 +67,7 @@ public RecordingStateInternal getRecordingState() { /** * Set the recordingState property: The recordingState property. - * + * * @param recordingState the recordingState value to set. * @return the RecordingStateResponseInternal object itself. */ @@ -70,7 +78,7 @@ public RecordingStateResponseInternal setRecordingState(RecordingStateInternal r /** * Get the recordingType property: The recordingType property. - * + * * @return the recordingType value. */ public RecordingType getRecordingType() { @@ -79,7 +87,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 2683f83ac474a..78fb625d43e07 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,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingStorageTypeInternal. */ +/** + * Defines the type of external storage. + */ 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. */ @@ -27,7 +42,11 @@ public static RecordingStorageTypeInternal fromString(String name) { return fromString(name, RecordingStorageTypeInternal.class); } - /** @return known RecordingStorageTypeInternal values. */ + /** + * Gets 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 b57759603d3b9..9152b81020040 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,17 +8,32 @@ 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. */ @@ -27,7 +42,11 @@ public static RecordingType fromString(String name) { return fromString(name, RecordingType.class); } - /** @return known RecordingType values. */ + /** + * Gets 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 b5e4e3ed3f17b..6c893b5826c17 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,7 +7,9 @@ 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 { /* @@ -23,14 +25,20 @@ public final class RedirectCallRequestInternal { private CommunicationIdentifierModel target; /* - * Used by customer to send custom context to targets + * Used by customer to send custom calling context to targets */ - @JsonProperty(value = "customContext") - private CustomContext customContext; + @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() { @@ -39,7 +47,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. */ @@ -50,7 +58,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() { @@ -59,7 +67,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. */ @@ -69,22 +77,22 @@ public RedirectCallRequestInternal setTarget(CommunicationIdentifierModel target } /** - * Get the customContext property: Used by customer to send custom context to targets. - * - * @return the customContext value. + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. */ - public CustomContext getCustomContext() { - return this.customContext; + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; } /** - * Set the customContext property: Used by customer to send custom context to targets. - * - * @param customContext the customContext value to set. + * 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. */ - public RedirectCallRequestInternal setCustomContext(CustomContext customContext) { - this.customContext = customContext; + public RedirectCallRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; return this; } } 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 b315242b2382e..9b4a2b4c1aa68 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,7 +7,9 @@ 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 { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,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. */ @@ -44,7 +52,7 @@ public RejectCallRequestInternal setIncomingCallContext(String incomingCallConte /** * Get the callRejectReason property: The rejection reason. - * + * * @return the callRejectReason value. */ public CallRejectReasonInternal getCallRejectReason() { @@ -53,7 +61,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 d300ea6a59c4d..70553ffe3a923 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 @@ -4,116 +4,60 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The failed to remove participant event. */ -@Fluent +/** + * The failed to remove participant event. + */ +@Immutable public final class RemoveParticipantFailed { /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId") - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId") - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) private String operationContext; /* - * Contains the resulting SIP code/sub-code and message from NGC services. + * Contains the resulting SIP code, sub-code and message. */ - @JsonProperty(value = "resultInformation") + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) private ResultInformation resultInformation; /* * Participant */ - @JsonProperty(value = "participant") + @JsonProperty(value = "participant", access = JsonProperty.Access.WRITE_ONLY) private CommunicationIdentifierModel participant; - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Set the callConnectionId property: Call connection ID. - * - * @param callConnectionId the callConnectionId value to set. - * @return the RemoveParticipantFailed object itself. - */ - public RemoveParticipantFailed setCallConnectionId(String callConnectionId) { - this.callConnectionId = callConnectionId; - return this; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. + /* + * Call connection ID. */ - public String getServerCallId() { - return this.serverCallId; - } + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; - /** - * Set the serverCallId property: Server call ID. - * - * @param serverCallId the serverCallId value to set. - * @return the RemoveParticipantFailed object itself. + /* + * Server call ID. */ - public RemoveParticipantFailed setServerCallId(String serverCallId) { - this.serverCallId = serverCallId; - return this; - } + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. */ - public String getCorrelationId() { - return this.correlationId; - } + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; /** - * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @param correlationId the correlationId value to set. - * @return the RemoveParticipantFailed object itself. + * Creates an instance of RemoveParticipantFailed class. */ - public RemoveParticipantFailed setCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; + 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() { @@ -121,54 +65,48 @@ 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 RemoveParticipantFailed object itself. + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. */ - public RemoveParticipantFailed setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; + public ResultInformation getResultInformation() { + return this.resultInformation; } /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. + * Get the participant property: Participant. + * + * @return the participant value. */ - public ResultInformation getResultInformation() { - return this.resultInformation; + public CommunicationIdentifierModel getParticipant() { + return this.participant; } /** - * Set the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @param resultInformation the resultInformation value to set. - * @return the RemoveParticipantFailed object itself. + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. */ - public RemoveParticipantFailed setResultInformation(ResultInformation resultInformation) { - this.resultInformation = resultInformation; - return this; + public String getCallConnectionId() { + return this.callConnectionId; } /** - * Get the participant property: Participant. - * - * @return the participant value. + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. */ - public CommunicationIdentifierModel getParticipant() { - return this.participant; + public String getServerCallId() { + return this.serverCallId; } /** - * Set the participant property: Participant. - * - * @param participant the participant value to set. - * @return the RemoveParticipantFailed object itself. + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype + * chain ID. + * + * @return the correlationId value. */ - public RemoveParticipantFailed setParticipant(CommunicationIdentifierModel participant) { - this.participant = participant; - return this; + public String getCorrelationId() { + return this.correlationId; } } 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 fae794b799f14..763c9de5704a2 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,7 +7,9 @@ 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 { /* @@ -17,21 +19,28 @@ 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; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @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() { @@ -40,7 +49,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. */ @@ -52,7 +61,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() { @@ -62,7 +71,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. */ @@ -72,22 +81,28 @@ public RemoveParticipantRequestInternal setOperationContext(String operationCont } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the RemoveParticipantRequestInternal object itself. */ - public RemoveParticipantRequestInternal setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public RemoveParticipantRequestInternal setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } 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 ac1747ed3cba5..f948b50eb5deb 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 8f1a2c0f09198..06916d92177d2 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 @@ -4,116 +4,60 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The participant removed event. */ -@Fluent +/** + * The participant removed event. + */ +@Immutable public final class RemoveParticipantSucceeded { /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId") - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId") - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) private String operationContext; /* - * Contains the resulting SIP code/sub-code and message from NGC services. + * Contains the resulting SIP code, sub-code and message. */ - @JsonProperty(value = "resultInformation") + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) private ResultInformation resultInformation; /* * Participant */ - @JsonProperty(value = "participant") + @JsonProperty(value = "participant", access = JsonProperty.Access.WRITE_ONLY) private CommunicationIdentifierModel participant; - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Set the callConnectionId property: Call connection ID. - * - * @param callConnectionId the callConnectionId value to set. - * @return the RemoveParticipantSucceeded object itself. - */ - public RemoveParticipantSucceeded setCallConnectionId(String callConnectionId) { - this.callConnectionId = callConnectionId; - return this; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. + /* + * Call connection ID. */ - public String getServerCallId() { - return this.serverCallId; - } + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; - /** - * Set the serverCallId property: Server call ID. - * - * @param serverCallId the serverCallId value to set. - * @return the RemoveParticipantSucceeded object itself. + /* + * Server call ID. */ - public RemoveParticipantSucceeded setServerCallId(String serverCallId) { - this.serverCallId = serverCallId; - return this; - } + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. */ - public String getCorrelationId() { - return this.correlationId; - } + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; /** - * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @param correlationId the correlationId value to set. - * @return the RemoveParticipantSucceeded object itself. + * Creates an instance of RemoveParticipantSucceeded class. */ - public RemoveParticipantSucceeded setCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; + 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() { @@ -121,54 +65,48 @@ 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 RemoveParticipantSucceeded object itself. + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. */ - public RemoveParticipantSucceeded setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; + public ResultInformation getResultInformation() { + return this.resultInformation; } /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. + * Get the participant property: Participant. + * + * @return the participant value. */ - public ResultInformation getResultInformation() { - return this.resultInformation; + public CommunicationIdentifierModel getParticipant() { + return this.participant; } /** - * Set the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @param resultInformation the resultInformation value to set. - * @return the RemoveParticipantSucceeded object itself. + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. */ - public RemoveParticipantSucceeded setResultInformation(ResultInformation resultInformation) { - this.resultInformation = resultInformation; - return this; + public String getCallConnectionId() { + return this.callConnectionId; } /** - * Get the participant property: Participant. - * - * @return the participant value. + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. */ - public CommunicationIdentifierModel getParticipant() { - return this.participant; + public String getServerCallId() { + return this.serverCallId; } /** - * Set the participant property: Participant. - * - * @param participant the participant value to set. - * @return the RemoveParticipantSucceeded object itself. + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype + * chain ID. + * + * @return the correlationId value. */ - public RemoveParticipantSucceeded setParticipant(CommunicationIdentifierModel participant) { - this.participant = participant; - return this; + public String getCorrelationId() { + return this.correlationId; } } 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 3063d5149440e..5a7c99c08920b 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,19 +7,21 @@ 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; @@ -30,10 +32,16 @@ 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() { @@ -43,7 +51,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. */ @@ -55,7 +63,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() { @@ -65,7 +73,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. */ @@ -76,7 +84,7 @@ public ResultInformation setSubCode(Integer subCode) { /** * Get the message property: Detail message that describes the current result. - * + * * @return the message value. */ public String getMessage() { @@ -85,7 +93,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/SendDtmfOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfOptionsInternal.java deleted file mode 100644 index 3a3dd0429fab4..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfOptionsInternal.java +++ /dev/null @@ -1,65 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The SendDtmfOptionsInternal model. */ -@Fluent -public final class SendDtmfOptionsInternal { - /* - * Target participant of Send DTMF tone. - */ - @JsonProperty(value = "targetParticipant", required = true) - private CommunicationIdentifierModel targetParticipant; - - /* - * The captured tones. - */ - @JsonProperty(value = "tones", required = true) - private List tones; - - /** - * Get the targetParticipant property: Target participant of Send DTMF tone. - * - * @return the targetParticipant value. - */ - public CommunicationIdentifierModel getTargetParticipant() { - return this.targetParticipant; - } - - /** - * Set the targetParticipant property: Target participant of Send DTMF tone. - * - * @param targetParticipant the targetParticipant value to set. - * @return the SendDtmfOptionsInternal object itself. - */ - public SendDtmfOptionsInternal setTargetParticipant(CommunicationIdentifierModel targetParticipant) { - this.targetParticipant = targetParticipant; - return this; - } - - /** - * Get the tones property: The captured tones. - * - * @return the tones value. - */ - public List getTones() { - return this.tones; - } - - /** - * Set the tones property: The captured tones. - * - * @param tones the tones value to set. - * @return the SendDtmfOptionsInternal object itself. - */ - public SendDtmfOptionsInternal setTones(List tones) { - this.tones = tones; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequest.java deleted file mode 100644 index 8d1064f0df719..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequest.java +++ /dev/null @@ -1,91 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The SendDtmfRequest model. */ -@Fluent -public final class SendDtmfRequest { - /* - * Target participant of Send DTMF tone. - */ - @JsonProperty(value = "targetParticipant", required = true) - private CommunicationIdentifierModel targetParticipant; - - /* - * The captured tones. - */ - @JsonProperty(value = "tones", required = true) - private List tones; - - /* - * The value to identify context of the operation. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the targetParticipant property: Target participant of Send DTMF tone. - * - * @return the targetParticipant value. - */ - public CommunicationIdentifierModel getTargetParticipant() { - return this.targetParticipant; - } - - /** - * Set the targetParticipant property: Target participant of Send DTMF tone. - * - * @param targetParticipant the targetParticipant value to set. - * @return the SendDtmfRequest object itself. - */ - public SendDtmfRequest setTargetParticipant(CommunicationIdentifierModel targetParticipant) { - this.targetParticipant = targetParticipant; - return this; - } - - /** - * Get the tones property: The captured tones. - * - * @return the tones value. - */ - public List getTones() { - return this.tones; - } - - /** - * Set the tones property: The captured tones. - * - * @param tones the tones value to set. - * @return the SendDtmfRequest object itself. - */ - public SendDtmfRequest setTones(List tones) { - this.tones = tones; - return this; - } - - /** - * Get the operationContext property: The value to identify context of the operation. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: The value to identify context of the operation. - * - * @param operationContext the operationContext value to set. - * @return the SendDtmfRequest object itself. - */ - public SendDtmfRequest setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java similarity index 50% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequestInternal.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java index c17d12f93fb5e..904d1be3eddd6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java @@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The SendDtmfRequestInternal model. */ +/** + * The SendDtmfTonesRequestInternal model. + */ @Fluent -public final class SendDtmfRequestInternal { +public final class SendDtmfTonesRequestInternal { /* * List of tones to be sent to target participant. */ @@ -18,7 +20,7 @@ public final class SendDtmfRequestInternal { private List tones; /* - * Target participant of send DTMF. + * Target participant of send Dtmf tones. */ @JsonProperty(value = "targetParticipant", required = true) private CommunicationIdentifierModel targetParticipant; @@ -30,14 +32,22 @@ public final class SendDtmfRequestInternal { private String operationContext; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @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() { @@ -46,18 +56,18 @@ 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 SendDtmfRequestInternal object itself. + * @return the SendDtmfTonesRequestInternal object itself. */ - public SendDtmfRequestInternal setTones(List tones) { + public SendDtmfTonesRequestInternal setTones(List tones) { this.tones = tones; return this; } /** - * Get the targetParticipant property: Target participant of send DTMF. - * + * Get the targetParticipant property: Target participant of send Dtmf tones. + * * @return the targetParticipant value. */ public CommunicationIdentifierModel getTargetParticipant() { @@ -65,19 +75,19 @@ public CommunicationIdentifierModel getTargetParticipant() { } /** - * Set the targetParticipant property: Target participant of send DTMF. - * + * Set the targetParticipant property: Target participant of send Dtmf tones. + * * @param targetParticipant the targetParticipant value to set. - * @return the SendDtmfRequestInternal object itself. + * @return the SendDtmfTonesRequestInternal object itself. */ - public SendDtmfRequestInternal setTargetParticipant(CommunicationIdentifierModel targetParticipant) { + public SendDtmfTonesRequestInternal 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() { @@ -86,32 +96,38 @@ public String getOperationContext() { /** * Set the operationContext property: The value to identify context of the operation. - * + * * @param operationContext the operationContext value to set. - * @return the SendDtmfRequestInternal object itself. + * @return the SendDtmfTonesRequestInternal object itself. */ - public SendDtmfRequestInternal setOperationContext(String operationContext) { + public SendDtmfTonesRequestInternal setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. - * @return the SendDtmfRequestInternal object itself. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. + * @return the SendDtmfTonesRequestInternal object itself. */ - public SendDtmfRequestInternal setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public SendDtmfTonesRequestInternal setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java similarity index 70% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantResponseInternal.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java index 936a81a62ffd9..9ee7c461d2eba 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java @@ -7,18 +7,26 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The response payload for unmuting participants from the call. */ +/** + * The SendDtmfTonesResultInternal model. + */ @Fluent -public final class HoldParticipantResponseInternal { +public final class SendDtmfTonesResultInternal { /* * The operation context provided by client. */ @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() { @@ -27,11 +35,11 @@ public String getOperationContext() { /** * Set the operationContext property: The operation context provided by client. - * + * * @param operationContext the operationContext value to set. - * @return the HoldParticipantResponseInternal object itself. + * @return the SendDtmfTonesResultInternal object itself. */ - public HoldParticipantResponseInternal setOperationContext(String operationContext) { + public SendDtmfTonesResultInternal setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SensitiveFlag.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SensitiveFlag.java deleted file mode 100644 index 0cd6a7d51efc9..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SensitiveFlag.java +++ /dev/null @@ -1,38 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SensitiveFlag model. */ -@Fluent -public final class SensitiveFlag { - /* - * The recording property. - */ - @JsonProperty(value = "recording") - private Integer recording; - - /** - * Get the recording property: The recording property. - * - * @return the recording value. - */ - public Integer getRecording() { - return this.recording; - } - - /** - * Set the recording property: The recording property. - * - * @param recording the recording value to set. - * @return the SensitiveFlag object itself. - */ - public SensitiveFlag setRecording(Integer recording) { - this.recording = recording; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java deleted file mode 100644 index db9f25d5a06ad..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java +++ /dev/null @@ -1,43 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Options for continuous speech recognition. */ -@Fluent -public final class SpeechOptions { - /* - * The length of end silence when user stops speaking and cogservice send response. - */ - @JsonProperty(value = "endSilenceTimeoutInMs") - private Long endSilenceTimeoutInMs; - - /** Creates an instance of SpeechOptions class. */ - public SpeechOptions() {} - - /** - * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send - * response. - * - * @return the endSilenceTimeoutInMs value. - */ - public Long getEndSilenceTimeoutInMs() { - return this.endSilenceTimeoutInMs; - } - - /** - * 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 SpeechOptions object itself. - */ - public SpeechOptions setEndSilenceTimeoutInMs(Long endSilenceTimeoutInMs) { - this.endSilenceTimeoutInMs = endSilenceTimeoutInMs; - return this; - } -} 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 1a1a9f084f090..e47d7a5a84ebb 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,20 +7,27 @@ 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() { @@ -30,7 +37,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/SpeechResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java deleted file mode 100644 index 4db6c4735835b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java +++ /dev/null @@ -1,41 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The speech status as a result. */ -@Fluent -public final class SpeechResult { - /* - * The recognized speech in string. - */ - @JsonProperty(value = "speech") - private String speech; - - /** Creates an instance of SpeechResult class. */ - public SpeechResult() {} - - /** - * Get the speech property: The recognized speech in string. - * - * @return the speech value. - */ - public String getSpeech() { - return this.speech; - } - - /** - * Set the speech property: The recognized speech in string. - * - * @param speech the speech value to set. - * @return the SpeechResult object itself. - */ - public SpeechResult setSpeech(String speech) { - this.speech = speech; - return this; - } -} 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 ab59123d5a646..a881c4a05b347 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The speech status as a result. */ +/** + * The speech recognition status as a result. + */ @Fluent public final class SpeechResultInternal { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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/SsmlSource.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSource.java deleted file mode 100644 index c594be01c341c..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSource.java +++ /dev/null @@ -1,41 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SsmlSource model. */ -@Fluent -public final class SsmlSource { - /* - * Ssml string for the cognitive service to be played - */ - @JsonProperty(value = "ssmlText", required = true) - private String ssmlText; - - /** Creates an instance of SsmlSource class. */ - public SsmlSource() {} - - /** - * Get the ssmlText property: Ssml string for the cognitive service to be played. - * - * @return the ssmlText value. - */ - public String getSsmlText() { - return this.ssmlText; - } - - /** - * Set the ssmlText property: Ssml string for the cognitive service to be played. - * - * @param ssmlText the ssmlText value to set. - * @return the SsmlSource object itself. - */ - public SsmlSource setSsmlText(String ssmlText) { - this.ssmlText = ssmlText; - return this; - } -} 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 80f99a142b29a..4d2f90ce2b83e 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The SsmlSourceInternal model. */ +/** + * The SsmlSourceInternal model. + */ @Fluent public final class SsmlSourceInternal { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,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. */ @@ -44,7 +52,7 @@ public SsmlSourceInternal setSsmlText(String ssmlText) { /** * Get the customVoiceEndpointId property: Endpoint where the custom voice was deployed. - * + * * @return the customVoiceEndpointId value. */ public String getCustomVoiceEndpointId() { @@ -53,7 +61,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 cefffe2baa743..39e5545db2ea6 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,7 +8,9 @@ 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 { /* @@ -42,24 +44,19 @@ 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") @@ -72,15 +69,20 @@ 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() { @@ -89,7 +91,7 @@ public CallLocatorInternal getCallLocator() { /** * Set the callLocator property: The call locator. - * + * * @param callLocator the callLocator value to set. * @return the StartCallRecordingRequestInternal object itself. */ @@ -100,7 +102,7 @@ public StartCallRecordingRequestInternal setCallLocator(CallLocatorInternal call /** * Get the recordingStateCallbackUri property: The uri to send notifications to. - * + * * @return the recordingStateCallbackUri value. */ public String getRecordingStateCallbackUri() { @@ -109,7 +111,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. */ @@ -120,7 +122,7 @@ public StartCallRecordingRequestInternal setRecordingStateCallbackUri(String rec /** * Get the recordingContentType property: The content type of call recording. - * + * * @return the recordingContentType value. */ public RecordingContentInternal getRecordingContentType() { @@ -129,7 +131,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. */ @@ -140,7 +142,7 @@ public StartCallRecordingRequestInternal setRecordingContentType(RecordingConten /** * Get the recordingChannelType property: The channel type of call recording. - * + * * @return the recordingChannelType value. */ public RecordingChannelInternal getRecordingChannelType() { @@ -149,7 +151,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. */ @@ -160,7 +162,7 @@ public StartCallRecordingRequestInternal setRecordingChannelType(RecordingChanne /** * Get the recordingFormatType property: The format type of call recording. - * + * * @return the recordingFormatType value. */ public RecordingFormatInternal getRecordingFormatType() { @@ -169,7 +171,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. */ @@ -180,11 +182,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() { @@ -193,25 +195,27 @@ 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() { @@ -219,10 +223,12 @@ 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. */ @@ -233,7 +239,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 transcriptionLocaleUpdated for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_LOCALE_UPDATED = fromString("transcriptionLocaleUpdated"); + /** + * 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. */ @@ -39,7 +62,11 @@ public static TranscriptionStatus fromString(String name) { return fromString(name, TranscriptionStatus.class); } - /** @return known TranscriptionStatus values. */ + /** + * 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/implementation/models/TranscriptionStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java index 70928e7d4f7d7..ee3bb1f80e3b3 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,42 +8,102 @@ 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. + */ + public static final TranscriptionStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure"); + + /** + * Static value badRequest for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails BAD_REQUEST = fromString("badRequest"); + + /** + * Static value tooManyRequests for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests"); + + /** + * Static value forbidden for TranscriptionStatusDetails. + */ + public static final TranscriptionStatusDetails FORBIDDEN = fromString("forbidden"); + + /** + * 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() { + } + /** * Creates or finds a TranscriptionStatusDetails from its string representation. - * + * * @param name a name to look for. * @return the corresponding TranscriptionStatusDetails. */ @@ -52,7 +112,11 @@ public static TranscriptionStatusDetails fromString(String name) { return fromString(name, TranscriptionStatusDetails.class); } - /** @return known TranscriptionStatusDetails values. */ + /** + * 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/implementation/models/TranscriptionStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java index dd27b183ce2e0..045b51b3ac1ef 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java @@ -4,128 +4,110 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The TranscriptionStopped model. */ -@Fluent +/** + * The TranscriptionStopped model. + */ +@Immutable public final class TranscriptionStopped { /* - * Call connection ID. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + private String operationContext; /* - * Server call ID. + * Contains the resulting SIP code, sub-code and message. */ - @JsonProperty(value = "serverCallId") - private String serverCallId; + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. + * Defines the result for TranscriptionUpdate with the current status and the details about the status */ - @JsonProperty(value = "correlationId") - private String correlationId; + @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) + private TranscriptionUpdate transcriptionUpdate; /* - * Used by customers when calling answerCall action to correlate the - * request to the response event. + * Call connection ID. */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; /* - * Contains the resulting SIP code/sub-code and message from NGC services. + * Server call ID. */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; /* - * Defines the result for TranscriptionUpdate with the current status and - * the details about the status + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. */ - @JsonProperty(value = "transcriptionUpdateResult", access = JsonProperty.Access.WRITE_ONLY) - private TranscriptionUpdate transcriptionUpdateResult; - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. + * Creates an instance of TranscriptionStopped class. */ - public String getServerCallId() { - return this.serverCallId; + public TranscriptionStopped() { } /** - * Set the serverCallId property: Server call ID. - * - * @param serverCallId the serverCallId value to set. - * @return the TranscriptionStopped object itself. + * 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 TranscriptionStopped setServerCallId(String serverCallId) { - this.serverCallId = serverCallId; - return this; + public String getOperationContext() { + return this.operationContext; } /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. */ - public String getCorrelationId() { - return this.correlationId; + public ResultInformation getResultInformation() { + return this.resultInformation; } /** - * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @param correlationId the correlationId value to set. - * @return the TranscriptionStopped object itself. + * Get the transcriptionUpdate property: Defines the result for TranscriptionUpdate with the current status and the + * details about the status. + * + * @return the transcriptionUpdate value. */ - public TranscriptionStopped setCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; + public TranscriptionUpdate getTranscriptionUpdate() { + return this.transcriptionUpdate; } /** - * Get the operationContext property: Used by customers when calling answerCall action to correlate the request to - * the response event. - * - * @return the operationContext value. + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. */ - public String getOperationContext() { - return this.operationContext; + public String getCallConnectionId() { + return this.callConnectionId; } /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. */ - public ResultInformation getResultInformation() { - return this.resultInformation; + public String getServerCallId() { + return this.serverCallId; } /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype + * chain ID. + * + * @return the correlationId value. */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; + public String getCorrelationId() { + return this.correlationId; } } 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/implementation/models/TranscriptionTransportType.java index 7809081719326..2078db6477565 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/implementation/models/TranscriptionTransportType.java @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TranscriptionTransportType. */ +/** + * The type of transport to be used for live transcription, eg. Websocket. + */ public final class TranscriptionTransportType extends ExpandableStringEnum { - /** Static value websocket for TranscriptionTransportType. */ + /** + * Static value websocket for TranscriptionTransportType. + */ public static final TranscriptionTransportType WEBSOCKET = fromString("websocket"); + /** + * Creates a new instance of TranscriptionTransportType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TranscriptionTransportType() { + } + /** * Creates or finds a TranscriptionTransportType from its string representation. - * + * * @param name a name to look for. * @return the corresponding TranscriptionTransportType. */ @@ -24,7 +37,11 @@ public static TranscriptionTransportType fromString(String name) { return fromString(name, TranscriptionTransportType.class); } - /** @return known TranscriptionTransportType values. */ + /** + * Gets known TranscriptionTransportType values. + * + * @return known TranscriptionTransportType values. + */ public static Collection values() { return values(TranscriptionTransportType.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 4996247fbfb75..306d9a2b5344c 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The TranscriptionUpdate model. */ +/** + * The TranscriptionUpdate model. + */ @Fluent public final class TranscriptionUpdate { /* @@ -22,9 +24,15 @@ 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() { @@ -33,7 +41,7 @@ public TranscriptionStatus getTranscriptionStatus() { /** * Set the transcriptionStatus property: The transcriptionStatus property. - * + * * @param transcriptionStatus the transcriptionStatus value to set. * @return the TranscriptionUpdate object itself. */ @@ -44,7 +52,7 @@ public TranscriptionUpdate setTranscriptionStatus(TranscriptionStatus transcript /** * Get the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * + * * @return the transcriptionStatusDetails value. */ public TranscriptionStatusDetails getTranscriptionStatusDetails() { @@ -53,7 +61,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 new file mode 100644 index 0000000000000..745ccccf55bde --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdated.java @@ -0,0 +1,113 @@ +// 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 a62c8d7ba903e..14ae4d5126106 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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/TransferToExternalNumber.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToExternalNumber.java deleted file mode 100644 index 19cd502470336..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToExternalNumber.java +++ /dev/null @@ -1,64 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TransferToExternalNumber model. */ -@Fluent -public final class TransferToExternalNumber { - /* - * The type property. - */ - @JsonProperty(value = "type") - private String type; - - /* - * The transferDestination property. - */ - @JsonProperty(value = "transferDestination") - private String transferDestination; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - public String getType() { - return this.type; - } - - /** - * Set the type property: The type property. - * - * @param type the type value to set. - * @return the TransferToExternalNumber object itself. - */ - public TransferToExternalNumber setType(String type) { - this.type = type; - return this; - } - - /** - * Get the transferDestination property: The transferDestination property. - * - * @return the transferDestination value. - */ - public String getTransferDestination() { - return this.transferDestination; - } - - /** - * Set the transferDestination property: The transferDestination property. - * - * @param transferDestination the transferDestination value to set. - * @return the TransferToExternalNumber object itself. - */ - public TransferToExternalNumber setTransferDestination(String transferDestination) { - this.transferDestination = transferDestination; - return this; - } -} 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 dadc2cb65a690..f10523a0d19f7 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,7 +7,9 @@ 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 { /* @@ -17,33 +19,40 @@ public final class TransferToParticipantRequestInternal { private CommunicationIdentifierModel targetParticipant; /* - * Used by customer to send custom context to targets + * Used by customer to send custom calling context to targets */ - @JsonProperty(value = "customContext") - private CustomContext customContext; + @JsonProperty(value = "customCallingContext") + 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; /* - * Transferee is the participant who is transferring the call. + * Transferee is the participant who is transferred away. */ @JsonProperty(value = "transferee") private CommunicationIdentifierModel transferee; /* - * The callback URI to override the main callback URI. + * 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 = "callbackUri") - private String callbackUri; + @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() { @@ -52,7 +61,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. */ @@ -62,29 +71,29 @@ public TransferToParticipantRequestInternal setTargetParticipant(CommunicationId } /** - * Get the customContext property: Used by customer to send custom context to targets. - * - * @return the customContext value. + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. */ - public CustomContext getCustomContext() { - return this.customContext; + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; } /** - * Set the customContext property: Used by customer to send custom context to targets. - * - * @param customContext the customContext value to set. + * 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. */ - public TransferToParticipantRequestInternal setCustomContext(CustomContext customContext) { - this.customContext = customContext; + public TransferToParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; return this; } /** * 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() { @@ -94,7 +103,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. */ @@ -104,8 +113,8 @@ public TransferToParticipantRequestInternal setOperationContext(String operation } /** - * Get the transferee property: Transferee is the participant who is transferring the call. - * + * Get the transferee property: Transferee is the participant who is transferred away. + * * @return the transferee value. */ public CommunicationIdentifierModel getTransferee() { @@ -113,8 +122,8 @@ public CommunicationIdentifierModel getTransferee() { } /** - * Set the transferee property: Transferee is the participant who is transferring the call. - * + * Set the transferee property: Transferee is the participant who is transferred away. + * * @param transferee the transferee value to set. * @return the TransferToParticipantRequestInternal object itself. */ @@ -124,22 +133,28 @@ public TransferToParticipantRequestInternal setTransferee(CommunicationIdentifie } /** - * Get the callbackUri property: The callback URI to override the main callback URI. - * - * @return the callbackUri value. + * 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. + * + * @return the operationCallbackUri value. */ - public String getCallbackUri() { - return this.callbackUri; + public String getOperationCallbackUri() { + return this.operationCallbackUri; } /** - * Set the callbackUri property: The callback URI to override the main callback URI. - * - * @param callbackUri the callbackUri value to set. + * 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. + * + * @param operationCallbackUri the operationCallbackUri value to set. * @return the TransferToParticipantRequestInternal object itself. */ - public TransferToParticipantRequestInternal setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; + public TransferToParticipantRequestInternal setOperationCallbackUri(String operationCallbackUri) { + this.operationCallbackUri = operationCallbackUri; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantRequestInternal.java deleted file mode 100644 index e7d7d054fa832..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdParticipantRequestInternal.java +++ /dev/null @@ -1,68 +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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The request payload for holding participant from the call. */ -@Fluent -public final class UnholdParticipantRequestInternal { - /* - * Participants to be hold from the call. - * Only ACS Users are supported. - */ - @JsonProperty(value = "participantToUnhold", required = true) - private CommunicationIdentifierModel participantToUnhold; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the participantToUnhold property: Participants to be hold from the call. Only ACS Users are supported. - * - * @return the participantToUnhold value. - */ - public CommunicationIdentifierModel getParticipantToUnhold() { - return this.participantToUnhold; - } - - /** - * Set the participantToUnhold property: Participants to be hold from the call. Only ACS Users are supported. - * - * @param participantToUnhold the participantToUnhold value to set. - * @return the UnholdParticipantRequestInternal object itself. - */ - public UnholdParticipantRequestInternal setParticipantToUnhold(CommunicationIdentifierModel participantToUnhold) { - this.participantToUnhold = participantToUnhold; - return this; - } - - /** - * 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; - } - - /** - * 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 UnholdParticipantRequestInternal object itself. - */ - public UnholdParticipantRequestInternal setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} 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 112653a62c30f..0730a0b450104 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,7 +8,9 @@ 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 { /* @@ -19,15 +21,21 @@ 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; /** - * Get the targetParticipants property: Participants to be unmuted from the call. Only ACS Users are supported. - * + * Creates an instance of UnmuteParticipantsRequestInternal class. + */ + public UnmuteParticipantsRequestInternal() { + } + + /** + * Get the targetParticipants property: Participants to be unmuted from the call. + * Only ACS Users are supported. + * * @return the targetParticipants value. */ public List getTargetParticipants() { @@ -35,13 +43,14 @@ 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; } @@ -49,7 +58,7 @@ public UnmuteParticipantsRequestInternal setTargetParticipants( /** * 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() { @@ -59,7 +68,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 6b26134362d09..b1ab8c3212427 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,7 +7,9 @@ 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 { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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/UpdateTranscriptionDataRequest.java index 2b525886399f8..f94b420ce1835 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/UpdateTranscriptionDataRequest.java @@ -16,6 +16,9 @@ public final class UpdateTranscriptionDataRequest { @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. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java new file mode 100644 index 0000000000000..001dc971d0640 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java @@ -0,0 +1,46 @@ +// 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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateTranscriptionRequest model. + */ +@Fluent +public final class UpdateTranscriptionRequest { + /* + * Defines new locale for transcription. + */ + @JsonProperty(value = "locale", required = true) + private String locale; + + /** + * Creates an instance of UpdateTranscriptionRequest class. + */ + public UpdateTranscriptionRequest() { + } + + /** + * Get the locale property: Defines new locale for transcription. + * + * @return the locale value. + */ + public String getLocale() { + return this.locale; + } + + /** + * Set the locale property: Defines new locale for transcription. + * + * @param locale the locale value to set. + * @return the UpdateTranscriptionRequest object itself. + */ + public UpdateTranscriptionRequest 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 7b3f2174ee6c2..30996987b7d9c 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,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The UserConsent model. */ +/** + * The UserConsent model. + */ @Fluent public final class UserConsent { /* @@ -16,9 +18,15 @@ 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() { @@ -27,7 +35,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 new file mode 100644 index 0000000000000..4beeeb8bb5f05 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java @@ -0,0 +1,53 @@ +// 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; + +/** + * Voice kind type. + */ +public final class VoiceKindInternal extends ExpandableStringEnum { + /** + * Static value male for VoiceKindInternal. + */ + public static final VoiceKindInternal MALE = fromString("male"); + + /** + * 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. + */ + @JsonCreator + public static VoiceKindInternal fromString(String name) { + return fromString(name, VoiceKindInternal.class); + } + + /** + * Gets 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 c5acfc47edf69..035147d5ef277 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 9bcf30c27c07e..269588854091c 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/AddParticipantOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantOptions.java index 4f13a1d2770ec..df004312ca737 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantOptions.java @@ -32,9 +32,9 @@ public final class AddParticipantOptions { private Duration invitationTimeout; /** - * The call back URI override. + * The overridden call back URL override for operation. */ - private String callbackUrl; + private String operationCallbackUrl; /** * Constructor @@ -63,12 +63,12 @@ public String getOperationContext() { } /** - * Get the call back URI override. + * Get the overridden call back URL override for operation. * - * @return the callbackUriOverride + * @return the operationCallbackUrl */ - public String getCallbackUrl() { - return callbackUrl; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** @@ -92,13 +92,14 @@ public AddParticipantOptions setOperationContext(String operationContext) { } /** - * Set the call back URI override. + * 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. * - * @param callbackUrl The call back URI override to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the AddParticipantOptions object itself. */ - public AddParticipantOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public AddParticipantOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } 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 4a080350eda88..2f56cf5a95c9c 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 @@ -26,10 +26,10 @@ public final class AnswerCallOptions { private MediaStreamingOptions mediaStreamingOptions; /* - * The endpoint URL of the Azure Cognitive Services resource attached + * AI options for the call. */ - private String azureCognitiveServicesUrl; - + private CallIntelligenceOptions callIntelligenceOptions; + /** * The operational context */ @@ -65,64 +65,62 @@ public String getCallbackUrl() { } /** - * Get the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. + * Get the operationContext. * - * @return the azureCognitiveServicesEndpointUrl value. + * @return the operationContext */ - public String getAzureCognitiveServicesUrl() { - return this.azureCognitiveServicesUrl; + public String getOperationContext() { + return operationContext; } - /** - * Get the Media Streaming configuration. + /** + * Set the operationContext. * - * @return the mediaStreamingConfiguration. + * @param operationContext the operationContext to set + * @return the AnswerCallOptions object itself. */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; + public AnswerCallOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; } - + /** - * Get the operationContext. + * Get the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint * - * @return the operationContext + * @return the callIntelligenceOptions value. */ - public String getOperationContext() { - return operationContext; + public CallIntelligenceOptions getCallIntelligenceOptions() { + return this.callIntelligenceOptions; } /** - * Set the media streaming configuration. + * Set the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint * - * @param mediaStreamingOptions The media streaming configuration. + * @param callIntelligenceOptions the cognitiveServicesEndpoint value to set. * @return the AnswerCallOptions object itself. */ - public AnswerCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; + public AnswerCallOptions setCallIntelligenceOptions(CallIntelligenceOptions callIntelligenceOptions) { + this.callIntelligenceOptions = callIntelligenceOptions; return this; } /** - * Set the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. + * Get the Media Streaming configuration. * - * @param azureCognitiveServicesUrl the azureCognitiveServicesEndpointUrl value to set. - * @return the AnswerCallOptions object itself. + * @return the mediaStreamingConfiguration. */ - public AnswerCallOptions setAzureCognitiveServicesUrl(String azureCognitiveServicesUrl) { - this.azureCognitiveServicesUrl = azureCognitiveServicesUrl; - return this; + public MediaStreamingOptions getMediaStreamingConfiguration() { + return mediaStreamingOptions; } - - /** - * Set the operationContext. + + /** + * Set the media streaming configuration. * - * @param operationContext the operationContext to set + * @param mediaStreamingOptions The media streaming configuration. * @return the AnswerCallOptions object itself. */ - public AnswerCallOptions setOperationContext(String operationContext) { - this.operationContext = operationContext; + public AnswerCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { + this.mediaStreamingOptions = mediaStreamingOptions; return this; } } 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 8e7601366ada0..9dd9128c3fbd7 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 @@ -23,14 +23,14 @@ public final class CallConnectionProperties { private final String callConnectionId; private final String serverCallId; - private final CommunicationIdentifier sourceIdentity; + private final CommunicationIdentifier source; private final PhoneNumberIdentifier sourceCallerIdNumber; private final String sourceDisplayName; private final List targetParticipants; private final CallConnectionState callConnectionState; private final String callbackUrl; private final String mediaSubscriptionId; - private final CommunicationUserIdentifier answeredByIdentifier; + private final CommunicationUserIdentifier answeredBy; private final String correlationId; static { @@ -49,7 +49,7 @@ public CallConnectionProperties create(CallConnectionPropertiesInternal internal */ public CallConnectionProperties() { this.callConnectionId = null; - this.sourceIdentity = null; + this.source = null; this.sourceCallerIdNumber = null; this.sourceDisplayName = null; this.serverCallId = null; @@ -57,7 +57,7 @@ public CallConnectionProperties() { this.callConnectionState = null; this.callbackUrl = null; this.mediaSubscriptionId = null; - this.answeredByIdentifier = null; + this.answeredBy = null; this.correlationId = null; } @@ -68,7 +68,7 @@ public CallConnectionProperties() { */ CallConnectionProperties(CallConnectionPropertiesInternal callConnectionPropertiesInternal) { this.callConnectionId = callConnectionPropertiesInternal.getCallConnectionId(); - this.sourceIdentity = CommunicationIdentifierConverter.convert(callConnectionPropertiesInternal.getSourceIdentity()); + this.source = CommunicationIdentifierConverter.convert(callConnectionPropertiesInternal.getSource()); this.sourceCallerIdNumber = PhoneNumberIdentifierConverter.convert(callConnectionPropertiesInternal.getSourceCallerIdNumber()); this.sourceDisplayName = callConnectionPropertiesInternal.getSourceDisplayName(); this.serverCallId = callConnectionPropertiesInternal.getServerCallId(); @@ -76,7 +76,7 @@ public CallConnectionProperties() { this.callConnectionState = CallConnectionState.fromString(callConnectionPropertiesInternal.getCallConnectionState().toString()); this.callbackUrl = callConnectionPropertiesInternal.getCallbackUri(); this.mediaSubscriptionId = callConnectionPropertiesInternal.getMediaSubscriptionId(); - this.answeredByIdentifier = CommunicationUserIdentifierConverter.convert(callConnectionPropertiesInternal.getAnsweredByIdentifier()); + this.answeredBy = CommunicationUserIdentifierConverter.convert(callConnectionPropertiesInternal.getAnsweredBy()); this.correlationId = callConnectionPropertiesInternal.getCorrelationId(); } @@ -92,19 +92,10 @@ public List getTargetParticipants() { /** * Get the source identity. * - * @return sourceIdentity value. + * @return source value. */ public CommunicationIdentifier getSource() { - return sourceIdentity; - } - - /** - * Get the source identity. - * - * @return sourceIdentity value. - */ - public CommunicationIdentifier getSourceIdentity() { - return sourceIdentity; + return source; } /** @@ -170,20 +161,12 @@ public String getMediaSubscriptionId() { return mediaSubscriptionId; } - /** - * Get identity that answered the call - * @return identity that answered the call - */ - public CommunicationUserIdentifier getAnsweredByIdentifier() { - return answeredByIdentifier; - } - /** * Get identity that answered the call * @return identity that answered the call */ public CommunicationUserIdentifier getAnsweredBy() { - return answeredByIdentifier; + return answeredBy; } /** diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallIntelligenceOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallIntelligenceOptions.java new file mode 100644 index 0000000000000..f620b5360d961 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallIntelligenceOptions.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.core.annotation.Fluent; + +/** + * AI options for the call. + */ +@Fluent +public final class CallIntelligenceOptions { + + + /** + * The endpoint URL of the Azure Cognitive Services resource attached + */ + private String cognitiveServicesEndpoint; + + /** + * Get the cognitiveServicesEndpoint property: The endpoint URL of the Azure Cognitive Services resource + * attached. + * + * @return the cognitiveServicesEndpoint value. + */ + public String getCognitiveServicesEndpoint() { + return this.cognitiveServicesEndpoint; + } + + /** + * Set the cognitiveServicesEndpoint property: The endpoint URL of the Azure Cognitive Services resource + * attached. + * + * @param cognitiveServicesEndpoint the cognitiveServicesEndpoint value to set. + * @return the CreateGroupCallOptions object itself. + */ + public CallIntelligenceOptions setCognitiveServicesEndpoint(String cognitiveServicesEndpoint) { + this.cognitiveServicesEndpoint = cognitiveServicesEndpoint; + return this; + } + +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java index eab0b1eaf3208..89c65abdeb84d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java @@ -5,23 +5,23 @@ package com.azure.communication.callautomation.models; -import java.util.HashMap; - import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.MicrosoftTeamsUserIdentifier; import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.annotation.Fluent; +import java.util.HashMap; + /** - * Call invitee details. + * Call invite details. */ @Fluent public final class CallInvite { private final CommunicationIdentifier targetParticipant; - private final PhoneNumberIdentifier sourceCallerIdNumber; + private PhoneNumberIdentifier sourceCallerIdNumber; private String sourceDisplayName; - private final CustomContext customContext; + private final CustomCallingContext customCallingContext; /** * Create a CallInvite object with PhoneNumberIdentifierr @@ -31,7 +31,7 @@ public final class CallInvite { public CallInvite(PhoneNumberIdentifier targetIdentity, PhoneNumberIdentifier callerIdNumber) { this.targetParticipant = targetIdentity; this.sourceCallerIdNumber = callerIdNumber; - this.customContext = new CustomContext(new HashMap(), null); + this.customCallingContext = new CustomCallingContext(new HashMap<>(), null); } /** @@ -41,7 +41,7 @@ public CallInvite(PhoneNumberIdentifier targetIdentity, PhoneNumberIdentifier ca public CallInvite(CommunicationUserIdentifier targetIdentity) { this.targetParticipant = targetIdentity; this.sourceCallerIdNumber = null; - this.customContext = new CustomContext(null, new HashMap()); + this.customCallingContext = new CustomCallingContext(null, new HashMap<>()); } /** @@ -51,7 +51,7 @@ public CallInvite(CommunicationUserIdentifier targetIdentity) { public CallInvite(MicrosoftTeamsUserIdentifier targetIdentity) { this.targetParticipant = targetIdentity; this.sourceCallerIdNumber = null; - this.customContext = new CustomContext(null, new HashMap()); + this.customCallingContext = new CustomCallingContext(null, new HashMap<>()); } /** @@ -81,11 +81,11 @@ public CallInvite setSourceDisplayName(String sourceDisplayName) { } /** - * get custom context - * @return custom context + * get custom calling context + * @return custom calling context */ - public CustomContext getCustomContext() { - return customContext; + public CustomCallingContext getCustomCallingContext() { + return customCallingContext; } /** @@ -95,4 +95,14 @@ public CustomContext getCustomContext() { public PhoneNumberIdentifier getSourceCallerIdNumber() { return sourceCallerIdNumber; } + + /** + * set PhoneNumberIdentifier for PSTN caller + * @param sourceCallerIdNumber PhoneNumberIdentifier for PSTN caller + * @return the CallInvite object itself + */ + public CallInvite setSourceCallerIdNumber(PhoneNumberIdentifier sourceCallerIdNumber) { + this.sourceCallerIdNumber = sourceCallerIdNumber; + return this; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java index 2fb7bde5918b0..d60e6b53f5bab 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java @@ -5,6 +5,7 @@ import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; import java.util.List; @@ -13,22 +14,29 @@ @Fluent public final class CallMediaRecognizeChoiceOptions extends CallMediaRecognizeOptions { /* - * List of recognize choice. + * List of recognition choices. */ - private final List recognizeChoices; + private final List choices; /* * Speech language to be recognized, If not set default is en-US */ + @JsonProperty(value = "speechLanguage") private String speechLanguage; + /* + * Endpoint where the custom model was deployed. + */ + @JsonProperty(value = "speechRecognitionModelEndpointId") + private String speechRecognitionModelEndpointId; + /** - * Get the list of recognize choice. + * Get the list of recognition choices. * - * @return the list of recognize choice. + * @return the list of recognition choices. */ - public List getRecognizeChoices() { - return this.recognizeChoices; + public List getChoices() { + return this.choices; } /** @@ -42,7 +50,7 @@ public CallMediaRecognizeChoiceOptions setSpeechLanguage(String speechLanguage) } /** - * Get the list of recognize choice. + * Get the speech language property. * * @return the speech language. */ @@ -50,6 +58,26 @@ public String getSpeechLanguage() { return this.speechLanguage; } + /** + * Get the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @return the speechRecognitionModelEndpointId value. + */ + public String getSpeechRecognitionModelEndpointId() { + return this.speechRecognitionModelEndpointId; + } + + /** + * Set the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @param speechRecognitionModelEndpointId the speechRecognitionModelEndpointId value to set. + * @return the CallMediaRecognizeChoiceOptions object itself. + */ + public CallMediaRecognizeChoiceOptions setSpeechRecognitionModelEndpointId(String speechRecognitionModelEndpointId) { + this.speechRecognitionModelEndpointId = speechRecognitionModelEndpointId; + return this; + } + /** * Set the recognizeInputType property: Determines the type of the recognition. * @@ -141,10 +169,10 @@ public CallMediaRecognizeChoiceOptions setInitialSilenceTimeout(Duration initial * Initializes a CallMediaRecognizeDtmfOptions object. * * @param targetParticipant Target participant of DTFM tone recognition. - * @param recognizeChoices Maximum number of DTMF tones to be collected. + * @param choices Maximum number of DTMF tones to be collected. */ - public CallMediaRecognizeChoiceOptions(CommunicationIdentifier targetParticipant, List recognizeChoices) { + public CallMediaRecognizeChoiceOptions(CommunicationIdentifier targetParticipant, List choices) { super(RecognizeInputType.CHOICES, targetParticipant); - this.recognizeChoices = recognizeChoices; + this.choices = choices; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java index 2f3f3c439c55f..618131e97c8db 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java @@ -4,62 +4,76 @@ package com.azure.communication.callautomation.models; import com.azure.communication.common.CommunicationIdentifier; +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; /** Options to configure the Recognize operation **/ +@Fluent public abstract class CallMediaRecognizeOptions { /* * Determines the type of the recognition. */ + @JsonProperty(value = "recognizeInputType", required = true) private RecognizeInputType recognizeInputType; /* * The source of the audio to be played for recognition. */ + @JsonProperty(value = "playPrompt") private PlaySource playPrompt; /* * If set recognize can barge into other existing * queued-up/currently-processing requests. */ + @JsonProperty(value = "interruptCallMediaOperation") private Boolean interruptCallMediaOperation; /* * If set recognize can barge into other existing * queued-up/currently-processing requests. */ + @JsonProperty(value = "stopCurrentOperations") private Boolean stopCurrentOperations; /* * The value to identify context of the operation. */ + @JsonProperty(value = "operationContext") private String operationContext; /* * Determines if we interrupt the prompt and start recognizing. */ + @JsonProperty(value = "interruptPrompt") private Boolean interruptPrompt; /* * Time to wait for first input after prompt (if any). */ + @JsonProperty(value = "initialSilenceTimeout") private Duration initialSilenceTimeout; /* * Endpoint where the custom model was deployed. */ + @JsonProperty(value = "speechModelEndpointId") private String speechModelEndpointId; - /* - * Target participant of DTFM tone recognition. + /* + * Target participant of DTMF tone recognition. */ - private final CommunicationIdentifier targetParticipant; + @JsonProperty(value = "targetParticipant") + private CommunicationIdentifier targetParticipant; /** - * The call back URI override. + * 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. */ - private String callbackUrl; + @JsonProperty(value = "operationCallbackUrl") + private String operationCallbackUrl; /** * Initializes a CallMediaRecognizeOptions object. @@ -227,42 +241,43 @@ public CommunicationIdentifier getTargetParticipant() { } /** - * Get the speech model endpoint id. + * Get the overridden call back URL override for operation. * - * @return the speech model endpoint id. + * @return the operationCallbackUrl */ - public String getSpeechModelEndpointId() { - return speechModelEndpointId; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** - * Set the speechModelEndpointId property: Endpoint where the custom model was deployed. + * 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. * - * @param speechModelEndpointId the initialSilenceTimeout value to set. - * @return the CallMediaRecognizeSpeechOrDtmfOptions object itself. + * @param operationCallbackUrl the operationCallbackUrl to set + * @return the CallMediaRecognizeOptions object itself. */ - public CallMediaRecognizeOptions setSpeechModelEndpointId(String speechModelEndpointId) { - this.speechModelEndpointId = speechModelEndpointId; + public CallMediaRecognizeOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } - /** - * Get the call back URI override. + /** + * Get the speech model endpoint id. * - * @return the callbackUriOverride + * @return the speech model endpoint id. */ - public String getCallbackUrl() { - return callbackUrl; + public String getSpeechModelEndpointId() { + return speechModelEndpointId; } - /** - * Set the call back URI override. + * Set the speechModelEndpointId property: Endpoint where the custom model was deployed. * - * @param callbackUrl The call back URI override to set - * @return the CallMediaRecognizeOptions object itself. + * @param speechModelEndpointId the initialSilenceTimeout value to set. + * @return the CallMediaRecognizeSpeechOrDtmfOptions object itself. */ - public CallMediaRecognizeOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public CallMediaRecognizeOptions setSpeechModelEndpointId(String speechModelEndpointId) { + this.speechModelEndpointId = speechModelEndpointId; return this; } + } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java index 651e7755735c1..774b7051b77eb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java @@ -3,28 +3,42 @@ package com.azure.communication.callautomation.models; -import java.time.Duration; - import com.azure.communication.common.CommunicationIdentifier; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + /** The Recognize configurations specific for Continuous Speech Recognition. **/ +@Fluent public class CallMediaRecognizeSpeechOptions extends CallMediaRecognizeOptions { /* * The length of end silence when user stops speaking and cogservice send * response. */ - @JsonProperty(value = "endSilenceTimeoutInMs") - private Duration endSilenceTimeoutInMs; + @JsonProperty(value = "endSilenceTimeout") + private Duration endSilenceTimeout; + + /* + * Speech language to be recognized, If not set default is en-US + */ + @JsonProperty(value = "speechLanguage") + private String speechLanguage; + + /* + * Endpoint where the custom model was deployed. + */ + @JsonProperty(value = "speechRecognitionModelEndpointId") + private String speechRecognitionModelEndpointId; /** - * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send + * Get the endSilenceTimeout property: The length of end silence when user stops speaking and cogservice send * response. * - * @return the endSilenceTimeoutInMs value. + * @return the endSilenceTimeout value. */ - public Duration getEndSilenceTimeoutInMs() { - return this.endSilenceTimeoutInMs; + public Duration getEndSilenceTimeout() { + return this.endSilenceTimeout; } /** @@ -114,14 +128,53 @@ public CallMediaRecognizeSpeechOptions setInitialSilenceTimeout(Duration initial return this; } + /** + * Set the speech language property. + * @param speechLanguage the speechLanguage value to set. + * @return the CallMediaRecognizeSpeechOptions object itself. + */ + public CallMediaRecognizeSpeechOptions setSpeechLanguage(String speechLanguage) { + this.speechLanguage = speechLanguage; + return this; + } + + /** + * Get the speech language property. + * + * @return the speech language. + */ + public String getSpeechLanguage() { + return this.speechLanguage; + } + + /** + * Get the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @return the speechRecognitionModelEndpointId value. + */ + public String getSpeechRecognitionModelEndpointId() { + return this.speechRecognitionModelEndpointId; + } + + /** + * Set the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @param speechRecognitionModelEndpointId the speechRecognitionModelEndpointId value to set. + * @return the CallMediaRecognizeSpeechOptions object itself. + */ + public CallMediaRecognizeSpeechOptions setSpeechRecognitionModelEndpointId(String speechRecognitionModelEndpointId) { + this.speechRecognitionModelEndpointId = speechRecognitionModelEndpointId; + return this; + } + /** * Initializes a CallMediaRecognizeSpeechOptions object. * * @param targetParticipant Target participant of continuous speech recognition. - * @param endSilenceTimeoutInMs the endSilenceTimeoutInMs value to set. + * @param endSilenceTimeout the endSilenceTimeout value to set. */ - public CallMediaRecognizeSpeechOptions(CommunicationIdentifier targetParticipant, Duration endSilenceTimeoutInMs) { + public CallMediaRecognizeSpeechOptions(CommunicationIdentifier targetParticipant, Duration endSilenceTimeout) { super(RecognizeInputType.SPEECH, targetParticipant); - this.endSilenceTimeoutInMs = endSilenceTimeoutInMs; + this.endSilenceTimeout = endSilenceTimeout; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java index 9465189aeedac..0dda8a407fd82 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java @@ -3,20 +3,34 @@ package com.azure.communication.callautomation.models; -import java.time.Duration; -import java.util.List; - import com.azure.communication.common.CommunicationIdentifier; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.util.List; + /** The Recognize configurations specific for Continuous Speech or DTMF Recognition. **/ +@Fluent public class CallMediaRecognizeSpeechOrDtmfOptions extends CallMediaRecognizeOptions { /* * The length of end silence when user stops speaking and cogservice send * response. */ - @JsonProperty(value = "endSilenceTimeoutInMs") - private Duration endSilenceTimeoutInMs; + @JsonProperty(value = "endSilenceTimeout") + private Duration endSilenceTimeout; + + /* + * Speech language to be recognized, If not set default is en-US + */ + @JsonProperty(value = "speechLanguage") + private String speechLanguage; + + /* + * Endpoint where the custom model was deployed. + */ + @JsonProperty(value = "speechRecognitionModelEndpointId") + private String speechRecognitionModelEndpointId; /* * Time to wait between DTMF inputs to stop recognizing. @@ -62,7 +76,7 @@ public CallMediaRecognizeSpeechOrDtmfOptions setInterToneTimeout(Duration interT * * @return the maxTonesToCollect value. */ - public Integer getMaxTonesToCollect() { + public int getMaxTonesToCollect() { return this.maxTonesToCollect; } @@ -87,13 +101,52 @@ public CallMediaRecognizeSpeechOrDtmfOptions setStopTones(List stopDtm } /** - * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send + * Get the endSilenceTimeout property: The length of end silence when user stops speaking and cogservice send * response. * - * @return the endSilenceTimeoutInMs value. + * @return the endSilenceTimeout value. + */ + public Duration getEndSilenceTimeout() { + return this.endSilenceTimeout; + } + + /** + * Set the speech language property. + * @param speechLanguage the speechLanguage value to set. + * @return the CallMediaRecognizeSpeechOrDtmfOptions object itself. + */ + public CallMediaRecognizeSpeechOrDtmfOptions setSpeechLanguage(String speechLanguage) { + this.speechLanguage = speechLanguage; + return this; + } + + /** + * Get the speech language property. + * + * @return the speech language. */ - public Duration getEndSilenceTimeoutInMs() { - return this.endSilenceTimeoutInMs; + public String getSpeechLanguage() { + return this.speechLanguage; + } + + /** + * Get the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @return the speechRecognitionModelEndpointId value. + */ + public String getSpeechRecognitionModelEndpointId() { + return this.speechRecognitionModelEndpointId; + } + + /** + * Set the speechRecognitionModelEndpointId property: Endpoint where the custom model was deployed. + * + * @param speechRecognitionModelEndpointId the speechRecognitionModelEndpointId value to set. + * @return the CallMediaRecognizeSpeechOrDtmfOptions object itself. + */ + public CallMediaRecognizeSpeechOrDtmfOptions setSpeechRecognitionModelEndpointId(String speechRecognitionModelEndpointId) { + this.speechRecognitionModelEndpointId = speechRecognitionModelEndpointId; + return this; } /** @@ -101,13 +154,12 @@ public Duration getEndSilenceTimeoutInMs() { * * @param targetParticipant Target participant of continuous speech recognition. * @param maxTonesToCollect Maximum number of DTMF tones to be collected. - * @param endSilenceTimeoutInMs the endSilenceTimeoutInMs value to set. + * @param endSilenceTimeout the endSilenceTimeout value to set. */ - public CallMediaRecognizeSpeechOrDtmfOptions(CommunicationIdentifier targetParticipant, int maxTonesToCollect, Duration endSilenceTimeoutInMs) { + public CallMediaRecognizeSpeechOrDtmfOptions(CommunicationIdentifier targetParticipant, int maxTonesToCollect, Duration endSilenceTimeout) { super(RecognizeInputType.SPEECH_OR_DTMF, targetParticipant); - this.endSilenceTimeoutInMs = endSilenceTimeoutInMs; + this.endSilenceTimeout = endSilenceTimeout; this.interToneTimeout = Duration.ofSeconds(2); this.maxTonesToCollect = maxTonesToCollect; } } - diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java index 4beb1af12b2c4..b203c3d4eb28c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java @@ -3,9 +3,8 @@ package com.azure.communication.callautomation.models; -import com.azure.communication.callautomation.models.events.AddParticipantCancelled; +import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; -import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Immutable; /** @@ -14,9 +13,8 @@ @Immutable public final class CancelAddParticipantEventResult { private final boolean isSuccess; - private final AddParticipantCancelled successResult; + private final CancelAddParticipantSucceeded successResult; private final CancelAddParticipantFailed failureResult; - private final CommunicationIdentifier participant; private final String invitationId; /** @@ -28,11 +26,10 @@ public final class CancelAddParticipantEventResult { * @param participant the participant. * @param invitationId the invitation id. */ - CancelAddParticipantEventResult(boolean isSuccess, AddParticipantCancelled successResult, CancelAddParticipantFailed failureResult, CommunicationIdentifier participant, String invitationId) { + CancelAddParticipantEventResult(boolean isSuccess, CancelAddParticipantSucceeded successResult, CancelAddParticipantFailed failureResult, String invitationId) { this.isSuccess = isSuccess; this.successResult = successResult; this.failureResult = failureResult; - this.participant = participant; this.invitationId = invitationId; } @@ -50,7 +47,7 @@ public boolean isSuccess() { * * @return the add participant cancelled success event. */ - public AddParticipantCancelled getSuccessResult() { + public CancelAddParticipantSucceeded getSuccessResult() { return successResult; } @@ -63,15 +60,6 @@ public CancelAddParticipantFailed getFailureResult() { return failureResult; } - /** - * Gets the participant. - * - * @return the participant. - */ - public CommunicationIdentifier getParticipant() { - return participant; - } - /** * Gets the invitation id. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java similarity index 54% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOptions.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java index 98a89a12325a6..fe32d6220837e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java @@ -9,7 +9,7 @@ * The options for cancelling add participant. */ @Fluent -public final class CancelAddParticipantOptions { +public final class CancelAddParticipantOperationOptions { /** * The inviation ID used to cancel the add participant request. */ @@ -21,16 +21,17 @@ public final class CancelAddParticipantOptions { private String operationContext; /** - * Callback URI override + * 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. */ - private String callbackUrl; + private String operationCallbackUrl; /** * Constructor * * @param invitationId The inviation ID used to cancel the add participant request. */ - public CancelAddParticipantOptions(String invitationId) { + public CancelAddParticipantOperationOptions(String invitationId) { this.invitationId = invitationId; } @@ -53,12 +54,12 @@ public String getOperationContext() { } /** - * Get the callback URI override. + * Get the overridden call back URL override for operation. * - * @return the callbackUriOverride + * @return the operationCallbackUrl */ - public String getCallbackUrl() { - return callbackUrl; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** @@ -67,19 +68,20 @@ public String getCallbackUrl() { * @param operationContext the operationContext to set * @return the CancelAddParticipantOptions object itself. */ - public CancelAddParticipantOptions setOperationContext(String operationContext) { + public CancelAddParticipantOperationOptions setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } /** - * Set the callbackUriOverride. + * 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. * - * @param callbackUrl the callbackUriOverride to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the CancelAddParticipantOptions object itself. */ - public CancelAddParticipantOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public CancelAddParticipantOperationOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java similarity index 75% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantResult.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java index e073a8bf0f0c4..d084f7757997a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java @@ -6,7 +6,7 @@ import com.azure.communication.callautomation.implementation.accesshelpers.CancelAddParticipantResponseConstructorProxy; import com.azure.communication.callautomation.implementation.accesshelpers.CancelAddParticipantResponseConstructorProxy.CancelAddParticipantResponseConstructorAccessor; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; -import com.azure.communication.callautomation.models.events.AddParticipantCancelled; +import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; import com.azure.core.annotation.Immutable; @@ -17,7 +17,7 @@ /** The CancelAddParticipantResult model. */ @Immutable -public final class CancelAddParticipantResult extends ResultWithEventHandling { +public final class CancelAddParticipantOperationResult extends ResultWithEventHandling { /** * The invitation ID used to cancel the add participant request. @@ -33,8 +33,8 @@ public final class CancelAddParticipantResult extends ResultWithEventHandling waitForEventProcessorAsync(Duration return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == AddParticipantCancelled.class || event.getClass() == CancelAddParticipantFailed.class)) + && (event.getClass() == CancelAddParticipantSucceeded.class || event.getClass() == CancelAddParticipantFailed.class)) : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == AddParticipantCancelled.class || event.getClass() == CancelAddParticipantFailed.class), timeout)).flatMap(event -> Mono.just(getReturnedEvent(event))); + && (event.getClass() == CancelAddParticipantSucceeded.class || event.getClass() == CancelAddParticipantFailed.class), timeout)).flatMap(event -> Mono.just(getReturnedEvent(event))); } @Override protected CancelAddParticipantEventResult getReturnedEvent(CallAutomationEventBase event) { CancelAddParticipantEventResult result = null; - if (event.getClass() == AddParticipantCancelled.class) { - result = new CancelAddParticipantEventResult(true, (AddParticipantCancelled) event, null, ((AddParticipantCancelled) event).getParticipant(), ((AddParticipantCancelled) event).getInvitationId()); + if (event.getClass() == CancelAddParticipantSucceeded.class) { + result = new CancelAddParticipantEventResult(true, (CancelAddParticipantSucceeded) event, null, ((CancelAddParticipantSucceeded) event).getInvitationId()); } else if (event.getClass() == CancelAddParticipantFailed.class) { - result = new CancelAddParticipantEventResult(false, null, (CancelAddParticipantFailed) event, null, ((CancelAddParticipantFailed) event).getInvitationId()); + result = new CancelAddParticipantEventResult(false, null, (CancelAddParticipantFailed) event, ((CancelAddParticipantFailed) event).getInvitationId()); } return result; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CollectTonesResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CollectTonesResult.java deleted file mode 100644 index 37e02b470fd3e..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CollectTonesResult.java +++ /dev/null @@ -1,55 +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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.stream.Collectors; - -/** The CollectTonesResult model. */ -@Fluent -public final class CollectTonesResult extends RecognizeResult { - /* - * The tones property. - */ - @JsonProperty(value = "tones") - private List dtmfTones; - - /** - * Get the tones property: The tones property. - * - * @return the tones value. - */ - public List getTones() { - return this.dtmfTones; - } - - /** - * Set the tones property: The tones property. - * - * @param dtmfTones the tones value to set. - * @return the CollectTonesResult object itself. - */ - public CollectTonesResult setTones(List dtmfTones) { - this.dtmfTones = dtmfTones; - return this; - } - - /** - * Set the tones property: The tones property. - * - * @return the CollectTonesResult object itself. - */ - public String convertToString() { - if (this.dtmfTones == null) { - return ""; - } - - return this.dtmfTones.stream() - .map(x -> x.convertToString()) - .collect(Collectors.joining()); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ContinuousDtmfRecognitionOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ContinuousDtmfRecognitionOptions.java new file mode 100644 index 0000000000000..da22d381abb58 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ContinuousDtmfRecognitionOptions.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.communication.common.CommunicationIdentifier; +import com.azure.core.annotation.Fluent; + +/** The ContinuousDtmfRecognitionOptions model. */ +@Fluent +public final class ContinuousDtmfRecognitionOptions { + + /** + * Constructor to build ContinuousDtmfRecognitionOptions object + * + * @param targetParticipant The target communication identifier. + */ + public ContinuousDtmfRecognitionOptions(CommunicationIdentifier targetParticipant) { + this.targetParticipant = targetParticipant; + } + + /** + * The target communication identifier. + */ + private final CommunicationIdentifier targetParticipant; + + /** + * The operation context + */ + private String operationContext; + + /** + * The overridden call back URL override for operation. + */ + private String operationCallbackUrl; + + + /** + * Get the targetParticipant property. + * + * @return the targetParticipant value. + */ + public CommunicationIdentifier getTargetParticipant() { + return targetParticipant; + } + + /** + * Get the operationContext property. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Set the operationContext property. + * + * @param operationContext the operationContext value to set. + * @return the PlayOptionsInternal object itself. + */ + public ContinuousDtmfRecognitionOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } + + /** + * Get the overridden call back URL override for operation. + * + * @return the operationCallbackUrl + */ + public String getOperationCallbackUrl() { + return operationCallbackUrl; + } + + /** + * 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. + * + * @param operationCallbackUrl the operationCallbackUrl to set + * @return the ContinuousDtmfRecognitionOptions object itself. + */ + public ContinuousDtmfRecognitionOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; + return this; + } +} 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 e9e4b4ebdf9ca..bf216115d125d 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 @@ -3,6 +3,8 @@ package com.azure.communication.callautomation.models; +import java.util.HashMap; + import com.azure.core.annotation.Fluent; /** @@ -21,20 +23,25 @@ public final class CreateCallOptions { private final String callbackUrl; /* - * The endpoint URL of the Azure Cognitive Services resource attached + * AI options for the call. */ - private String azureCognitiveServicesUrl; + private CallIntelligenceOptions callIntelligenceOptions; /** * A customer set value used to track the answering of a call. */ private String operationContext; - /** + /** * Media Streaming Configuration. */ private MediaStreamingOptions mediaStreamingOptions; + /** + * Custom Context + */ + private final CustomCallingContext customContext; + /** * Constructor * @param callInvite Call invitee information. @@ -43,60 +50,75 @@ public final class CreateCallOptions { public CreateCallOptions(CallInvite callInvite, String callbackUrl) { this.callInvite = callInvite; this.callbackUrl = callbackUrl; + this.customContext = new CustomCallingContext(new HashMap(), new HashMap()); } /** - * Get the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. + * Get the operationContext: A customer set value used to track the answering of a call. * - * @return the azureCognitiveServicesEndpointUrl value. + * @return the operationContext value. */ - public String getAzureCognitiveServicesUrl() { - return azureCognitiveServicesUrl; + public String getOperationContext() { + return operationContext; } /** - * Set the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. + * Set the operationContext: A customer set value used to track the answering of a call. * - * @param azureCognitiveServicesUrl the azureCognitiveServicesEndpointUrl value to set. - * @return the AnswerCallRequestInternal object itself. + * @param operationContext A customer set value used to track the answering of a call. + * @return the CreateCallOptions object itself. */ - public CreateCallOptions setAzureCognitiveServicesUrl(String azureCognitiveServicesUrl) { - this.azureCognitiveServicesUrl = azureCognitiveServicesUrl; + public CreateCallOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; return this; } /** - * Get the operationContext: A customer set value used to track the answering of a call. - * - * @return the operationContext value. + * Get Call invitee information + * @return call invitee information */ - public String getOperationContext() { - return operationContext; + public CallInvite getCallInvite() { + return callInvite; } /** - * Get the Media Streaming configuration. + * Get the call back uri. * - * @return the mediaStreamingConfiguration. + * @return the call back uri. */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; + public String getCallbackUrl() { + return callbackUrl; } + /** + * Get the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint + * + * @return the callIntelligenceOptions value. + */ + public CallIntelligenceOptions getCallIntelligenceOptions() { + return this.callIntelligenceOptions; + } /** - * Set the operationContext: A customer set value used to track the answering of a call. + * Set the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint * - * @param operationContext A customer set value used to track the answering of a call. + * @param callIntelligenceOptions the cognitiveServicesEndpoint value to set. * @return the CreateCallOptions object itself. */ - public CreateCallOptions setOperationContext(String operationContext) { - this.operationContext = operationContext; + public CreateCallOptions setCallIntelligenceOptions(CallIntelligenceOptions callIntelligenceOptions) { + this.callIntelligenceOptions = callIntelligenceOptions; return this; } + /** + * Get the Media Streaming configuration. + * + * @return the mediaStreamingConfiguration. + */ + public MediaStreamingOptions getMediaStreamingConfiguration() { + return mediaStreamingOptions; + } + /** * Set the media streaming configuration. * @@ -109,19 +131,10 @@ public CreateCallOptions setMediaStreamingConfiguration(MediaStreamingOptions me } /** - * Get Call invitee information - * @return call invitee information + * get custom context + * @return custom context */ - public CallInvite getCallInvite() { - return callInvite; - } - - /** - * Get the call back uri. - * - * @return the call back uri. - */ - public String getCallbackUrl() { - return callbackUrl; + public CustomCallingContext getCustomContext() { + return customContext; } } 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 798902cf3df26..f7239c054b42c 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 @@ -25,21 +25,11 @@ public final class CreateGroupCallOptions { */ private final String callbackUrl; - /* - * The endpoint URL of the Azure Cognitive Services resource attached - */ - private String azureCognitiveServicesUrl; - /** * A customer set value used to track the answering of a call. */ private String operationContext; - /** - * Media Streaming Configuration. - */ - private MediaStreamingOptions mediaStreamingOptions; - /** * Display name for call source */ @@ -50,13 +40,20 @@ public final class CreateGroupCallOptions { */ private PhoneNumberIdentifier sourceCallIdNumber; - /** - * Custom Context + /* + * AI options for the call */ - private final CustomContext customContext; - + private CallIntelligenceOptions callIntelligenceOptions; + /** + * Media Streaming Configuration. + */ + private MediaStreamingOptions mediaStreamingOptions; + /** + * Custom Context + */ + private final CustomCallingContext customContext; /** * Constructor @@ -69,7 +66,7 @@ public CreateGroupCallOptions(List targetParticipants, this.callbackUrl = callbackUrl; this.sourceDisplayName = null; this.sourceCallIdNumber = null; - this.customContext = new CustomContext(new HashMap(), new HashMap()); + this.customContext = new CustomCallingContext(new HashMap(), new HashMap()); } /** @@ -90,16 +87,6 @@ public String getCallbackUrl() { return callbackUrl; } - /** - * Get the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. - * - * @return the azureCognitiveServicesEndpointUrl value. - */ - public String getAzureCognitiveServicesUrl() { - return this.azureCognitiveServicesUrl; - } - /** * Get the operationContext: A customer set value used to track the answering of a call. * @@ -109,15 +96,6 @@ public String getOperationContext() { return operationContext; } - /** - * Get the Media Streaming configuration. - * - * @return the mediaStreamingConfiguration. - */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; - } - /** * get caller's display name * @return display name for caller @@ -134,14 +112,6 @@ public PhoneNumberIdentifier getSourceCallIdNumber() { return sourceCallIdNumber; } - /** - * get custom context - * @return custom context - */ - public CustomContext getCustomContext() { - return customContext; - } - /** * Set the operationContext: A customer set value used to track the answering of a call. * @@ -153,29 +123,6 @@ public CreateGroupCallOptions setOperationContext(String operationContext) { return this; } - /** - * Set the media streaming configuration. - * - * @param mediaStreamingOptions The media streaming configuration. - * @return the CreateCallOptions object itself. - */ - public CreateGroupCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; - return this; - } - - /** - * Set the azureCognitiveServicesEndpointUrl property: The endpoint URL of the Azure Cognitive Services resource - * attached. - * - * @param azureCognitiveServicesUrl the azureCognitiveServicesEndpointUrl value to set. - * @return the AnswerCallRequestInternal object itself. - */ - public CreateGroupCallOptions setAzureCognitiveServicesUrl(String azureCognitiveServicesUrl) { - this.azureCognitiveServicesUrl = azureCognitiveServicesUrl; - return this; - } - /** * set display name for caller * @param sourceDisplayName display name for caller @@ -195,4 +142,52 @@ public CreateGroupCallOptions setSourceCallIdNumber(PhoneNumberIdentifier source this.sourceCallIdNumber = sourceCallIdNumber; return this; } + + /** + * Get the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint + * + * @return the callIntelligenceOptions value. + */ + public CallIntelligenceOptions getCallIntelligenceOptions() { + return this.callIntelligenceOptions; + } + + /** + * Set the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint + * + * @param callIntelligenceOptions the cognitiveServicesEndpoint value to set. + * @return the CreateGroupCallOptions object itself. + */ + public CreateGroupCallOptions setCallIntelligenceOptions(CallIntelligenceOptions callIntelligenceOptions) { + this.callIntelligenceOptions = callIntelligenceOptions; + return this; + } + + /** + * Get the Media Streaming configuration. + * + * @return the mediaStreamingConfiguration. + */ + public MediaStreamingOptions getMediaStreamingConfiguration() { + return mediaStreamingOptions; + } + + /** + * Set the media streaming configuration. + * + * @param mediaStreamingOptions The media streaming configuration. + * @return the CreateCallOptions object itself. + */ + public CreateGroupCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { + this.mediaStreamingOptions = mediaStreamingOptions; + return this; + } + + /** + * get custom context + * @return custom context + */ + public CustomCallingContext getCustomContext() { + return customContext; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java new file mode 100644 index 0000000000000..8841676ab9856 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java @@ -0,0 +1,97 @@ +// 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; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; + +import java.util.Map; + +/** + * Custom calling context details. + */ +@Fluent +public final class CustomCallingContext { + private final Map sipHeaders; + private final Map voipHeaders; + private final ClientLogger logger; + + /** + * Create a CustomCallingContext object with SIP and VOIP headers + * + * @param sipHeaders custom context SIP headers + * @param voipHeaders custom context VOIP headers + */ + CustomCallingContext(Map sipHeaders, Map voipHeaders) { + this.sipHeaders = sipHeaders; + this.voipHeaders = voipHeaders; + this.logger = new ClientLogger(CustomCallingContext.class); + } + + /** + * Get list of custom context SIP headers + * + * @return list of custom context SIP headers + */ + public Map getSipHeaders() { + return sipHeaders; + } + + /** + * Get list of custom context VOIP headers + * + * @return list of custom context VOIP headers + */ + public Map getVoipHeaders() { + return voipHeaders; + } + + /** + * Add a custom context sip UUI header. The Key always remains 'User-To-User' + * + * @param value custom context sip UUI header's value. + * @throws IllegalStateException If sipHeaders is null + */ + public void addSipUui(String value) { + if (sipHeaders == null) { + throw logger.logExceptionAsError(new IllegalStateException( + "Cannot add sip header, SipHeaders is null.")); + } + sipHeaders.put("User-To-User", value); + } + + + /** + * Add a custom context sip X header. The provided key is appended to 'X-MS-Custom-' in last. + * + * @param key custom context sip x header's key. + * @param value custom context sip x header's value. + * @throws IllegalStateException If sipHeaders is null + */ + public void addSipX(String key, String value) { + if (sipHeaders == null) { + throw logger.logExceptionAsError(new IllegalStateException( + "Cannot add sip header, SipHeaders is null.")); + } + sipHeaders.put("X-MS-Custom-" + key, value); + } + + + /** + * Add a custom context voip header. + * + * @param key custom context voip header's key. + * @param value custom context voip header's value. + * @throws IllegalStateException If voipHeaders is null + */ + public void addVoip(String key, String value) { + if (sipHeaders == null) { + throw logger.logExceptionAsError(new IllegalStateException( + "Cannot add sip header, VoipHeaders is null.")); + } + voipHeaders.put(key, value); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContext.java deleted file mode 100644 index 55439989bf54b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContext.java +++ /dev/null @@ -1,81 +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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; - -import java.util.Map; - -/** - * Custom context details. - */ -@Fluent -public final class CustomContext { - private final Map sipHeaders; - private final Map voipHeaders; - private final ClientLogger logger; - - /** - * Create a CustomContext object with SIP and VOIP headers - * @param sipHeaders custom context SIP headers - * @param voipHeaders custom context VOIP headers - */ - CustomContext(Map sipHeaders, Map voipHeaders) { - this.sipHeaders = sipHeaders; - this.voipHeaders = voipHeaders; - this.logger = new ClientLogger(CustomContext.class); - } - - /** - * Get list of custom context SIP headers - * @return list of custom context SIP headers - */ - public Map getSipHeaders() { - return sipHeaders; - } - - /** - * Get list of custom context VOIP headers - * @return list of custom context VOIP headers - */ - public Map getVoipHeaders() { - return voipHeaders; - } - - /** - * Add or update a custom context header - * @param header the custom context SIP UUI, SIP custom or VOIP header - * @throws IllegalStateException If sipHeaders or voipHeaders is null - */ - public void addOrUpdate(CustomContextHeader header) { - if (header instanceof SIPUUIHeader) { - if (sipHeaders == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add sip header, SipHeaders is null.")); - } - SIPUUIHeader sipUUIHeader = (SIPUUIHeader) header; - sipHeaders.put(sipUUIHeader.getKey(), sipUUIHeader.getValue()); - } else if (header instanceof SIPCustomHeader) { - if (sipHeaders == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add sip header, SipHeaders is null.")); - } - SIPCustomHeader sipCustomHeader = (SIPCustomHeader) header; - sipHeaders.put(sipCustomHeader.getKey(), sipCustomHeader.getValue()); - } else if (header instanceof VoipHeader) { - if (voipHeaders == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add voip header, VoipHeaders is null.")); - } - VoipHeader voipHeader = (VoipHeader) header; - voipHeaders.put(voipHeader.getKey(), voipHeader.getValue()); - } else { - throw logger.logExceptionAsError(new IllegalStateException( - "Unknown custom context header type.")); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContextHeader.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContextHeader.java deleted file mode 100644 index ecc2d6c4c0d76..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomContextHeader.java +++ /dev/null @@ -1,43 +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.models; - -import com.azure.core.annotation.Fluent; - -/** - * Custom context header. - */ -@Fluent -public abstract class CustomContextHeader { - private final String key; - private final String value; - - /** - * Create a CustomContextHeader object with key and value - * @param key the header key - * @param value the header value - */ - public CustomContextHeader(String key, String value) { - this.key = key; - this.value = value; - } - - /** - * get custom context header key - * @return custom context header key - */ - public String getKey() { - return key; - } - - /** - * get custom context header value - * @return custom context header value - */ - public String getValue() { - return value; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/GenderType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/GenderType.java deleted file mode 100644 index b787a3d2e4e8b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/GenderType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for GenderType. */ -public final class GenderType extends ExpandableStringEnum { - /** Static value male for GenderType. */ - public static final GenderType MALE = fromString("male"); - - /** Static value female for GenderType. */ - public static final GenderType FEMALE = fromString("female"); - - /** - * Creates or finds a GenderType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GenderType. - */ - @JsonCreator - public static GenderType fromString(String name) { - return fromString(name, GenderType.class); - } - - /** - * Gets known GenderType values. - * - * @return known GenderType values. - */ - public static Collection values() { - return values(GenderType.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantOptions.java similarity index 66% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsOptions.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantOptions.java index de6485d554e44..46f2d8774abaf 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantOptions.java @@ -6,19 +6,16 @@ import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Fluent; -import java.util.List; - /** * The options for muting a participant. */ @Fluent -public final class MuteParticipantsOptions { +public final class MuteParticipantOptions { /** - * The participants to mute. - * Only one participant currently supported. + * The participant to mute. * Only ACS Users are currently supported. */ - private final List targetParticipant; + private final CommunicationIdentifier targetParticipant; /** * The operational context @@ -30,16 +27,16 @@ public final class MuteParticipantsOptions { * * @param targetParticipant The targetParticipant to mute. */ - public MuteParticipantsOptions(List targetParticipant) { + public MuteParticipantOptions(CommunicationIdentifier targetParticipant) { this.targetParticipant = targetParticipant; } /** * Get the participant. * - * @return the participants to mute. + * @return the participant to mute. */ - public List getTargetParticipant() { + public CommunicationIdentifier getTargetParticipant() { return targetParticipant; } @@ -56,9 +53,9 @@ public String getOperationContext() { * Set the operationContext. * * @param operationContext the operationContext to set - * @return the MuteParticipantsOptions object itself. + * @return the MuteParticipantOptions object itself. */ - public MuteParticipantsOptions setOperationContext(String operationContext) { + public MuteParticipantOptions setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java similarity index 77% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsResult.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java index 4b8e9b653bb57..d8bbf105fee80 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantsResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java @@ -4,37 +4,37 @@ package com.azure.communication.callautomation.models; import com.azure.communication.callautomation.implementation.accesshelpers.MuteParticipantsResponseConstructorProxy; -import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.core.annotation.Immutable; import java.util.Objects; -/** The MuteParticipantsResult model. */ +/** The MuteParticipantResult model. */ @Immutable -public final class MuteParticipantsResult { +public final class MuteParticipantResult { /* * The operation context provided by client. */ private final String operationContext; static { - MuteParticipantsResponseConstructorProxy.setAccessor(MuteParticipantsResult::new); + MuteParticipantsResponseConstructorProxy.setAccessor(MuteParticipantResult::new); } /** * Public constructor. * */ - public MuteParticipantsResult() { + public MuteParticipantResult() { this.operationContext = null; } /** * Package-private constructor of the class, used internally only. * - * @param muteParticipantsResponseInternal The response from the service + * @param MuteParticipantsResultInternal The response from the service */ - MuteParticipantsResult(MuteParticipantsResponseInternal muteParticipantsResponseInternal) { + MuteParticipantResult(MuteParticipantsResultInternal muteParticipantsResponseInternal) { Objects.requireNonNull(muteParticipantsResponseInternal, "muteParticipantsResponseInternal must not be null"); this.operationContext = muteParticipantsResponseInternal.getOperationContext(); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java index 8016c735abc6f..0f89fb69e9819 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java @@ -6,16 +6,17 @@ import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Fluent; -import java.util.Collections; +import java.util.ArrayList; import java.util.List; /** The PlayOptions model. */ @Fluent public final class PlayOptions { /* - * A {@link PlaySource} representing the source to play. + * A List of {@link PlaySource} representing the sources to play. + * Currently only single play source per request is supported. */ - private final PlaySource playSource; + private final List playSources; /* * The targets to play to @@ -33,9 +34,10 @@ public final class PlayOptions { private String operationContext; /** - * The call back URI override. + * 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. */ - private String callbackUrl; + private String operationCallbackUrl; /** * Constructor @@ -43,7 +45,8 @@ public final class PlayOptions { * @param playTo The targets to play to. */ public PlayOptions(List playSources, List playTo) { - this(playSources.get(0), playTo); + this.playSources = playSources; + this.playTo = playTo; } /** @@ -52,26 +55,18 @@ public PlayOptions(List playSources, List p * @param playTo The targets to play to. */ public PlayOptions(PlaySource playSource, List playTo) { - this.playSource = playSource; + this.playSources = new ArrayList<>(); + this.playSources.add(playSource); this.playTo = playTo; } - /** - * Get the play source. - * - * @return the playSource value. - */ - public PlaySource getPlaySource() { - return this.playSource; - } - /** * Get the play sources. * * @return the playSources value. */ public List getPlaySources() { - return Collections.singletonList(playSource); + return this.playSources; } /** @@ -101,15 +96,6 @@ public String getOperationContext() { return this.operationContext; } - /** - * Get the call back URI override. - * - * @return the callbackUriOverride - */ - public String getCallbackUrl() { - return callbackUrl; - } - /** * Set the loop property: The option to play the provided audio source in loop when set to true. * @@ -133,13 +119,23 @@ public PlayOptions setOperationContext(String operationContext) { } /** - * Set the call back URI override. + * Get the overridden call back URL override for operation. + * + * @return the operationCallbackUrl + */ + public String getOperationCallbackUrl() { + return operationCallbackUrl; + } + + /** + * 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. * - * @param callbackUrl The call back URI override to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the PlayOptions object itself. */ - public PlayOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public PlayOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlaySource.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlaySource.java index defab66c2d0a9..8aef2e2553f0e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlaySource.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlaySource.java @@ -12,17 +12,8 @@ public abstract class PlaySource { /* * Defines the identifier to be used for caching related media */ - @JsonProperty(value = "playSourceId") - private String playSourceId; - - /** - * Get the playSourceId property: Defines the identifier to be used for caching related media. - * - * @return the playSourceId value. - */ - public String getPlaySourceId() { - return this.playSourceId; - } + @JsonProperty(value = "playSourceCacheId") + private String playSourceCacheId; /** * Get the playSourceCacheId property: Defines the identifier to be used for caching related media. @@ -30,18 +21,7 @@ public String getPlaySourceId() { * @return the playSourceCacheId value. */ public String getPlaySourceCacheId() { - return this.playSourceId; - } - - /** - * Set the playSourceId property: Defines the identifier to be used for caching related media. - * - * @param playSourceId the playSourceId value to set. - * @return the PlaySourceInternal object itself. - */ - public PlaySource setPlaySourceId(String playSourceId) { - this.playSourceId = playSourceId; - return this; + return this.playSourceCacheId; } /** @@ -51,6 +31,7 @@ public PlaySource setPlaySourceId(String playSourceId) { * @return the PlaySourceInternal object itself. */ public PlaySource setPlaySourceCacheId(String playSourceCacheId) { - return setPlaySourceId(playSourceCacheId); + this.playSourceCacheId = playSourceCacheId; + return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java index 738749f568f56..ceb4d80c7c2b9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java @@ -3,18 +3,19 @@ package com.azure.communication.callautomation.models; -import com.azure.core.annotation.Fluent; - -import java.util.Collections; +import java.util.ArrayList; import java.util.List; +import com.azure.core.annotation.Fluent; + /** The PlayToAllOptions model. */ @Fluent public final class PlayToAllOptions { /* - * A {@link PlaySource} representing the source to play. + * A List of {@link PlaySource} representing the sources to play. + * Currently only single play source per request is supported. */ - private final PlaySource playSource; + private final List playSources; /* * The option to play the provided audio source in loop when set to true @@ -27,16 +28,17 @@ public final class PlayToAllOptions { private String operationContext; /** - * The call back URI override. + * 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. */ - private String callbackUrl; + private String operationCallbackUrl; /** * Constructor * @param playSources A List of {@link PlaySource} representing the sources to play. */ public PlayToAllOptions(List playSources) { - this(playSources.get(0)); + this.playSources = playSources; } /** @@ -44,7 +46,8 @@ public PlayToAllOptions(List playSources) { * @param playSource A {@link PlaySource} representing the source to play. */ public PlayToAllOptions(PlaySource playSource) { - this.playSource = playSource; + this.playSources = new ArrayList<>(); + this.playSources.add(playSource); } /** @@ -53,16 +56,7 @@ public PlayToAllOptions(PlaySource playSource) { * @return the playSource value. */ public List getPlaySources() { - return Collections.singletonList(playSource); - } - - /** - * Get the play source. - * - * @return the playSource value. - */ - public PlaySource getPlaySource() { - return this.playSource; + return this.playSources; } /** @@ -84,12 +78,12 @@ public String getOperationContext() { } /** - * Get the call back URI override. + * Get the overridden call back URL override for operation. * - * @return the callbackUriOverride + * @return the operationCallbackUrl */ - public String getCallbackUrl() { - return callbackUrl; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** @@ -115,13 +109,14 @@ public PlayToAllOptions setOperationContext(String operationContext) { } /** - * Set the call back URI override. + * 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. * - * @param callbackUrl The call back URI override to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the PlayToAllOptions object itself. */ - public PlayToAllOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public PlayToAllOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeChoice.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java similarity index 78% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeChoice.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java index 422cb9527a7b7..841de3f13d138 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeChoice.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java @@ -4,10 +4,11 @@ package com.azure.communication.callautomation.models; import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.List; -/** The RecognizeChoice model. */ -public final class RecognizeChoice { +/** The RecognitionChoice model. */ +public final class RecognitionChoice { /* * Identifier for a given choice */ @@ -39,9 +40,9 @@ public String getLabel() { * Set the label property: Identifier for a given choice. * * @param label the label value to set. - * @return the RecognizeChoice object itself. + * @return the RecognitionChoice object itself. */ - public RecognizeChoice setLabel(String label) { + public RecognitionChoice setLabel(String label) { this.label = label; return this; } @@ -56,12 +57,12 @@ public List getPhrases() { } /** - * Set the phrases property: List of phrases to recognize. + * Set the phrases property: The phrases property. * * @param phrases the phrases value to set. - * @return the RecognizeChoice object itself. + * @return the RecognitionChoice object itself. */ - public RecognizeChoice setPhrases(List phrases) { + public RecognitionChoice setPhrases(List phrases) { this.phrases = phrases; return this; } @@ -79,11 +80,10 @@ public DtmfTone getTone() { * Set the tone property: The tone property. * * @param tone the tone value to set. - * @return the RecognizeChoice object itself. + * @return the RecognitionChoice object itself. */ - public RecognizeChoice setTone(DtmfTone tone) { + public RecognitionChoice setTone(DtmfTone tone) { this.tone = tone; return this; } } - diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RemoveParticipantOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RemoveParticipantOptions.java index 79633408fa6b6..3864c0f0efea5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RemoveParticipantOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RemoveParticipantOptions.java @@ -23,9 +23,10 @@ public final class RemoveParticipantOptions { private String operationContext; /** - * Callback URI override + * 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. */ - private String callbackUrl; + private String operationCallbackUrl; /** * Constructor @@ -55,12 +56,12 @@ public String getOperationContext() { } /** - * Get the callback URI override. + * Get the overridden call back URL override for operation. * - * @return the callbackUriOverride + * @return the operationCallbackUrl */ - public String getCallbackUrl() { - return callbackUrl; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** @@ -75,13 +76,14 @@ public RemoveParticipantOptions setOperationContext(String operationContext) { } /** - * Set the callbackUriOverride. + * 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. * - * @param callbackUrl the callbackUriOverride to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the RemoveParticipantOptions object itself. */ - public RemoveParticipantOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public RemoveParticipantOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPCustomHeader.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPCustomHeader.java deleted file mode 100644 index 144bd523cfd8b..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPCustomHeader.java +++ /dev/null @@ -1,23 +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.models; - -import com.azure.core.annotation.Fluent; - -/** - * Custom context SIP UUI header. - */ -@Fluent -public final class SIPCustomHeader extends CustomContextHeader { - /** - * Create a SIPCustomHeader object with key and value - * @param key the header key - * @param value the header value - */ - public SIPCustomHeader(String key, String value) { - super("X-MS-Custom-" + key, value); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPUUIHeader.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPUUIHeader.java deleted file mode 100644 index e8dcd764c0235..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SIPUUIHeader.java +++ /dev/null @@ -1,23 +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.models; - -import com.azure.core.annotation.Fluent; - -/** - * Custom context SIP UUI header. - */ -@Fluent -public final class SIPUUIHeader extends CustomContextHeader { - - /** - * Create a SIPUUIHeader object with value - * @param value the UUI value - */ - public SIPUUIHeader(String value) { - super("User-to-User", value); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesOptions.java new file mode 100644 index 0000000000000..7cc76c852768b --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesOptions.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.communication.common.CommunicationIdentifier; +import com.azure.core.annotation.Fluent; + +import java.util.List; + +/** The SendDtmfTonesOptions model. */ +@Fluent +public final class SendDtmfTonesOptions { + + /** + * Constructor to build SendDtmfTonesOptions object + * + * @param tones List of Tones to be sent. + * @param targetParticipant The target communication identifier. + */ + public SendDtmfTonesOptions(List tones, CommunicationIdentifier targetParticipant) { + this.tones = tones; + this.targetParticipant = targetParticipant; + } + + /** + * A list of Tones to be sent. + */ + private final List tones; + + /** + * The target communication identifier. + */ + private final CommunicationIdentifier targetParticipant; + + /** + * The operation context + */ + private String operationContext; + + /** + * The overridden call back URL override for operation. + */ + private String operationCallbackUrl; + + /** + * Get the list of Tones to be sent. + * + * @return the list of Tones to be sent. + */ + public List getTones() { + return tones; + } + + /** + * Get the targetParticipant property. + * + * @return the targetParticipant value. + */ + public CommunicationIdentifier getTargetParticipant() { + return targetParticipant; + } + + /** + * Get the operationContext property. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Set the operationContext property. + * + * @param operationContext the operationContext value to set. + * @return the PlayOptionsInternal object itself. + */ + public SendDtmfTonesOptions setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } + + /** + * Get the overridden call back URL override for operation. + * + * @return the operationCallbackUrl + */ + public String getOperationCallbackUrl() { + return operationCallbackUrl; + } + + /** + * 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. + * + * @param operationCallbackUrl the operationCallbackUrl to set + * @return the SendDtmfTonesOptions object itself. + */ + public SendDtmfTonesOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesResult.java new file mode 100644 index 0000000000000..aae8668e14f33 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SendDtmfTonesResult.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.communication.callautomation.implementation.accesshelpers.SendDtmfTonesResponseConstructorProxy; +import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; +import com.azure.core.annotation.Immutable; + +import java.util.Objects; + +/** The SendDtmfTonesResult model. */ +@Immutable +public final class SendDtmfTonesResult { + + /* + * The operation context provided by client. + */ + private final String operationContext; + + static { + SendDtmfTonesResponseConstructorProxy.setAccessor( + new SendDtmfTonesResponseConstructorProxy.SendDtmfTonesResponseConstructorAccessor() { + @Override + public SendDtmfTonesResult create(SendDtmfTonesResultInternal internalHeaders) { + return new SendDtmfTonesResult(internalHeaders); + } + }); + } + + /** + * Public constructor. + * + */ + public SendDtmfTonesResult() { + this.operationContext = null; + } + + /** + * Constructor of the class + * + * @param sendDtmfTonesResultInternal The response from the sendDtmfTones service + */ + SendDtmfTonesResult(SendDtmfTonesResultInternal sendDtmfTonesResultInternal) { + Objects.requireNonNull(sendDtmfTonesResultInternal, "sendDtmfTonesResultInternal must not be null"); + + this.operationContext = sendDtmfTonesResultInternal.getOperationContext(); + } + + /** + * Get the operationContext property: The operation context provided by client. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SpeechResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SpeechResult.java index 64d97e67c1706..548fc5765dd88 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SpeechResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SpeechResult.java @@ -2,12 +2,19 @@ // Licensed under the MIT License. package com.azure.communication.callautomation.models; -import com.fasterxml.jackson.annotation.JsonProperty; + import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; /** The continuous speech recognition result. */ @Fluent +@Immutable public final class SpeechResult extends RecognizeResult { + + private SpeechResult() { + } + /* * The recognized speech in string. */ @@ -22,15 +29,4 @@ public final class SpeechResult extends RecognizeResult { public String getSpeech() { return this.speech; } - - /** - * Set the speech property: The recognized speech in string. - * - * @param speech the speech value to set. - * @return the SpeechResult object itself. - */ - public SpeechResult setSpeech(String speech) { - this.speech = speech; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TextSource.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TextSource.java index 235c990dcaf22..420cb61557f77 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TextSource.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TextSource.java @@ -22,10 +22,10 @@ public final class TextSource extends PlaySource { private String sourceLocale; /* - * Voice gender type + * Voice kind type */ - @JsonProperty(value = "voiceGender") - private GenderType voiceGender; + @JsonProperty(value = "voiceKind") + private VoiceKind voiceKind; /* * Voice name to be played @@ -34,7 +34,7 @@ public final class TextSource extends PlaySource { private String voiceName; /* - * Endpoint where the Custom Voice was deployed. + * Endpoint where the custom voice was deployed. */ @JsonProperty(value = "customVoiceEndpointId") private String customVoiceEndpointId; @@ -80,22 +80,22 @@ public TextSource setSourceLocale(String sourceLocale) { } /** - * Get the voiceGender property: Voice gender type. + * Get the voiceKind property: Voice kind type. * - * @return the voiceGender value. + * @return the voiceKind value. */ - public GenderType getVoiceGender() { - return this.voiceGender; + public VoiceKind getVoiceKind() { + return this.voiceKind; } /** - * Set the voiceGender property: Voice gender type. + * Set the voiceKind property: Voice kind type. * - * @param voiceGender the voiceGender value to set. + * @param voiceKind the voiceKind value to set. * @return the TextSource object itself. */ - public TextSource setVoiceGender(GenderType voiceGender) { - this.voiceGender = voiceGender; + public TextSource setVoiceKind(VoiceKind voiceKind) { + this.voiceKind = voiceKind; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ToneInfo.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ToneInfo.java deleted file mode 100644 index 447422a575576..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ToneInfo.java +++ /dev/null @@ -1,66 +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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The information about the tone. */ -@Fluent -public final class ToneInfo { - /* - * The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. - */ - @JsonProperty(value = "sequenceId", required = true) - private int sequenceId; - - /* - * The tone property. - */ - @JsonProperty(value = "tone", required = true) - private DtmfTone tone; - - /** - * Get the sequenceId property: The sequence id which can be used to determine if the same tone was played multiple - * times or if any tones were missed. - * - * @return the sequenceId value. - */ - public int getSequenceId() { - return this.sequenceId; - } - - /** - * Set the sequenceId property: The sequence id which can be used to determine if the same tone was played multiple - * times or if any tones were missed. - * - * @param sequenceId the sequenceId value to set. - * @return the ToneInfo object itself. - */ - public ToneInfo setSequenceId(int sequenceId) { - this.sequenceId = sequenceId; - return this; - } - - /** - * Get the tone property: The tone property. - * - * @return the tone value. - */ - public DtmfTone getTone() { - return this.tone; - } - - /** - * Set the tone property: The tone property. - * - * @param tone the tone value to set. - * @return the ToneInfo object itself. - */ - public ToneInfo setTone(DtmfTone tone) { - this.tone = tone; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantOptions.java index 1bab7c4868a11..cb74223275f50 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantOptions.java @@ -16,12 +16,15 @@ */ @Fluent public final class TransferCallToParticipantOptions { + /** + * The identity of the target where call should be transferred to. + */ private final CommunicationIdentifier targetParticipant; - private final CustomContext customContext; - private String callbackUrl; + private final CustomCallingContext customCallingContext; + private String operationCallbackUrl; /** - * Participant being transferred away + * Transferee is the participant who is transferred away */ private CommunicationIdentifier transferee; @@ -35,41 +38,41 @@ public final class TransferCallToParticipantOptions { /** * Constructor * - * @param targetParticipant {@link CommunicationIdentifier}contains information for TranferTarget. + * @param targetParticipant {@link CommunicationIdentifier} contains information for TransferTarget(to whom the call is transferred). */ public TransferCallToParticipantOptions(CommunicationIdentifier targetParticipant) { this.targetParticipant = targetParticipant; - this.customContext = new CustomContext(new HashMap(), new HashMap()); + this.customCallingContext = new CustomCallingContext(new HashMap<>(), new HashMap<>()); } /** * Constructor * - * @param targetParticipant {@link CommunicationUserIdentifier}contains information for TranferTarget. + * @param targetParticipant {@link CommunicationUserIdentifier} contains information for TransferTarget(to whom the call is transferred). */ public TransferCallToParticipantOptions(CommunicationUserIdentifier targetParticipant) { this.targetParticipant = targetParticipant; - this.customContext = new CustomContext(null, new HashMap()); + this.customCallingContext = new CustomCallingContext(null, new HashMap<>()); } /** * Constructor * - * @param targetParticipant {@link PhoneNumberIdentifier}contains information for TranferTarget. + * @param targetParticipant {@link PhoneNumberIdentifier} contains information for TransferTarget(to whom the call is transferred). */ public TransferCallToParticipantOptions(PhoneNumberIdentifier targetParticipant) { this.targetParticipant = targetParticipant; - this.customContext = new CustomContext(new HashMap(), null); + this.customCallingContext = new CustomCallingContext(new HashMap<>(), null); } /** * Constructor * - * @param targetParticipant {@link MicrosoftTeamsUserIdentifier}contains information for TranferTarget. + * @param targetParticipant {@link MicrosoftTeamsUserIdentifier} contains information for TransferTarget(to whom the call is transferred). */ public TransferCallToParticipantOptions(MicrosoftTeamsUserIdentifier targetParticipant) { this.targetParticipant = targetParticipant; - this.customContext = new CustomContext(null, new HashMap()); + this.customCallingContext = new CustomCallingContext(null, new HashMap<>()); } /** @@ -93,7 +96,7 @@ public TransferCallToParticipantOptions setOperationContext(String operationCont } /** - * Get transferee. + * Get the participant who is being transferred away. * * @return the transferee */ @@ -102,9 +105,9 @@ public CommunicationIdentifier getTransferee() { } /** - * Set the transferee. + * Set the participant who is being transferred away. * - * @param transferee the transferee to set + * @param transferee the participant who is being transferred away * @return the TransferCallToParticipantOptions object itself. */ public TransferCallToParticipantOptions setTransferee(CommunicationIdentifier transferee) { @@ -113,7 +116,7 @@ public TransferCallToParticipantOptions setTransferee(CommunicationIdentifier tr } /** - * Get the call information to transfer target + * Get the transfer target to whom the call is transferred * @return a {@link CommunicationIdentifier} with information to transfer target */ public CommunicationIdentifier getTargetParticipant() { @@ -124,27 +127,28 @@ public CommunicationIdentifier getTargetParticipant() { * get custom context * @return custom context */ - public CustomContext getCustomContext() { - return customContext; + public CustomCallingContext getCustomCallingContext() { + return customCallingContext; } /** - * Get the callbackUrlOverride. + * Get the overridden call back URL override for operation. * - * @return the callbackUrlOverride + * @return the operationCallbackUrl */ - public String getCallbackUrl() { - return callbackUrl; + public String getOperationCallbackUrl() { + return operationCallbackUrl; } /** - * Set the 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. * - * @param callbackUrl the callbackUrlOverride to set + * @param operationCallbackUrl the operationCallbackUrl to set * @return the TransferCallToParticipantOptions object itself. */ - public TransferCallToParticipantOptions setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; + public TransferCallToParticipantOptions setOperationCallbackUrl(String operationCallbackUrl) { + this.operationCallbackUrl = operationCallbackUrl; return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java similarity index 66% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsOptions.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java index b5e9438d2ad7c..6c1341c81709f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java @@ -6,19 +6,16 @@ import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Fluent; -import java.util.List; - /** * The options for unmuting a participant. */ @Fluent -public final class UnmuteParticipantsOptions { +public final class UnmuteParticipantOptions { /** * The participants to unmute. - * Only one participant currently supported. * Only ACS Users are currently supported. */ - private final List targetParticipant; + private final CommunicationIdentifier targetParticipant; /** * The operational context @@ -30,16 +27,16 @@ public final class UnmuteParticipantsOptions { * * @param targetParticipant The participants to unmute. */ - public UnmuteParticipantsOptions(List targetParticipant) { + public UnmuteParticipantOptions(CommunicationIdentifier targetParticipant) { this.targetParticipant = targetParticipant; } /** - * Get the participants. + * Get the participant. * - * @return the participants to mute. + * @return the participant to unmute. */ - public List getTargetParticipant() { + public CommunicationIdentifier getTargetParticipant() { return targetParticipant; } @@ -56,9 +53,9 @@ public String getOperationContext() { * Set the operationContext. * * @param operationContext the operationContext to set - * @return the UnmuteParticipantsOptions object itself. + * @return the UnmuteParticipantOptions object itself. */ - public UnmuteParticipantsOptions setOperationContext(String operationContext) { + public UnmuteParticipantOptions setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java similarity index 86% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsResult.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java index 2857c1c98f06a..8a3d95295b0db 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantsResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java @@ -11,21 +11,21 @@ /** The UnmuteParticipantsResult model. */ @Immutable -public final class UnmuteParticipantsResult { +public final class UnmuteParticipantResult { /* * The operation context provided by client. */ private final String operationContext; static { - UnmuteParticipantsResponseConstructorProxy.setAccessor(UnmuteParticipantsResult::new); + UnmuteParticipantsResponseConstructorProxy.setAccessor(UnmuteParticipantResult::new); } /** * Public constructor. * */ - public UnmuteParticipantsResult() { + public UnmuteParticipantResult() { this.operationContext = null; } @@ -34,7 +34,7 @@ public UnmuteParticipantsResult() { * * @param unmuteParticipantsResponseInternal The response from the service */ - UnmuteParticipantsResult(UnmuteParticipantsResponseInternal unmuteParticipantsResponseInternal) { + UnmuteParticipantResult(UnmuteParticipantsResponseInternal unmuteParticipantsResponseInternal) { Objects.requireNonNull(unmuteParticipantsResponseInternal, "unmuteParticipantsResponseInternal must not be null"); this.operationContext = unmuteParticipantsResponseInternal.getOperationContext(); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoiceKind.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoiceKind.java new file mode 100644 index 0000000000000..b51baf8e399e6 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoiceKind.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.Collection; + +/** Defines values for VoiceKind. */ +public final class VoiceKind extends ExpandableStringEnum { + /** Static value male for VoiceKind. */ + public static final VoiceKind MALE = fromString("male"); + + /** Static value female for VoiceKind. */ + public static final VoiceKind FEMALE = fromString("female"); + + /** + * Creates or finds a VoiceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding VoiceKind. + */ + @JsonCreator + public static VoiceKind fromString(String name) { + return fromString(name, VoiceKind.class); + } + + /** + * Gets known VoiceKind values. + * + * @return known VoiceKind values. + */ + public static Collection values() { + return values(VoiceKind.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoipHeader.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoipHeader.java deleted file mode 100644 index 53433b322e46e..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/VoipHeader.java +++ /dev/null @@ -1,23 +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.models; - -import com.azure.core.annotation.Fluent; - -/** - * Custom context VOIP header. - */ -@Fluent -public class VoipHeader extends CustomContextHeader { - /** - * Create a VoipHeader object with key and value - * @param key the header key - * @param value the header value - */ - public VoipHeader(String key, String value) { - super(key, value); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AddParticipantCancelled.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AddParticipantCancelled.java deleted file mode 100644 index 97d31467ba7dc..0000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AddParticipantCancelled.java +++ /dev/null @@ -1,61 +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.models.events; - -import java.util.Map; - -import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; -import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** The AddParticipantCancelled model. */ -@Immutable -public final class AddParticipantCancelled extends CallAutomationEventBase { - /* - * The invitation ID used to cancel the add participant request. - */ - @JsonProperty(value = "invitationId") - private final String invitationId; - - /* - * Participant who's invitation was cancelled - */ - @JsonIgnore - private final CommunicationIdentifier participant; - - @JsonCreator - private AddParticipantCancelled(@JsonProperty("participant") Map participant) { - invitationId = null; - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - this.participant = CommunicationIdentifierConverter - .convert(mapper.convertValue(participant, CommunicationIdentifierModel.class)); - } - - /** - * Get the participant property: Participant who's invitation was cancelled. - * - * @return the participant value. - */ - public CommunicationIdentifier getParticipant() { - return this.participant; - } - - /** - * Get the invitationId property: The invitation ID used to cancel the add - * participant request. - * - * @return the invitationId value. - */ - public String getInvitationId() { - return invitationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CallTransferAccepted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CallTransferAccepted.java index ec5fe541cf07a..74771e884db8a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CallTransferAccepted.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CallTransferAccepted.java @@ -24,19 +24,19 @@ public final class CallTransferAccepted extends CallAutomationEventBase { */ @JsonProperty(value = "resultInformation") private final ResultInformation resultInformation; - + /** - * Participant being transferred away + * The participant who is being transferred away. */ @JsonIgnore private final CommunicationIdentifier transferee; - + /** - * The target transferee is transferred to + * Target to whom the call is transferred. */ @JsonIgnore private final CommunicationIdentifier transferTarget; - + @JsonCreator private CallTransferAccepted( @JsonProperty("transferee") Map transferee, @@ -57,18 +57,18 @@ private CallTransferAccepted( public ResultInformation getResultInformation() { return this.resultInformation; } - + /** - * Participant being transferred away + * The participant who is being transferred away * @return the transferee value */ public CommunicationIdentifier getTransferee() { return this.transferee; } - + /** - * The target transferee is transferred to - * @return the tansferTarget value + * Target to whom the call is transferred. + * @return the transferTarget value */ public CommunicationIdentifier getTransferTarget() { return this.transferTarget; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CancelAddParticipantSucceeded.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CancelAddParticipantSucceeded.java new file mode 100644 index 0000000000000..2c781e5ba9e1b --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CancelAddParticipantSucceeded.java @@ -0,0 +1,34 @@ +// 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.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CancelAddParticipantSucceeded model. */ +@Immutable +public final class CancelAddParticipantSucceeded extends CallAutomationEventBase { + /* + * The invitation ID used to cancel the add participant request. + */ + @JsonProperty(value = "invitationId") + private final String invitationId; + + @JsonCreator + private CancelAddParticipantSucceeded() { + invitationId = null; + } + + /** + * Get the invitationId property: The invitation ID used to cancel the add + * participant request. + * + * @return the invitationId value. + */ + public String getInvitationId() { + return invitationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java index c9173163480ff..32a0fceb2f0e7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java @@ -3,7 +3,7 @@ package com.azure.communication.callautomation.models.events; -import com.azure.communication.callautomation.models.ToneInfo; +import com.azure.communication.callautomation.models.DtmfTone; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,10 +12,16 @@ public final class ContinuousDtmfRecognitionToneReceived extends CallAutomationEventBase { /* - * Information about Tone. + * The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. */ - @JsonProperty(value = "toneInfo", access = JsonProperty.Access.WRITE_ONLY) - private ToneInfo toneInfo; + @JsonProperty(value = "sequenceId", required = true) + private final Integer sequenceId; + + /* + * The tone property. + */ + @JsonProperty(value = "tone", required = true) + private final DtmfTone tone; /* * Contains the resulting SIP code, sub-code and message. @@ -27,16 +33,28 @@ public final class ContinuousDtmfRecognitionToneReceived extends CallAutomationE * Constructor for ContinuousDtmfRecognitionToneReceived */ public ContinuousDtmfRecognitionToneReceived() { - toneInfo = null; resultInformation = null; + sequenceId = 0; + tone = null; } /** - * getter for toneInfo property - * @return return toneInfo value + * Get sequenceId: The sequence id which can be used to determine if the same tone was played multiple + * times or if any tones were missed. + * + * @return the sequenceId value. + */ + public int getSequenceId() { + return this.sequenceId; + } + + /** + * Get the tone property: + * + * @return the tone value. */ - public ToneInfo getToneInfo() { - return toneInfo; + public DtmfTone getTone() { + return this.tone; } /** diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java index 58606b797a791..9fa3e81cc45fd 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java @@ -5,6 +5,8 @@ import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** Defines values for ReasonCode. */ public final class ReasonCode extends ExpandableStringEnum { /** Reason code names for the Recognize operation */ @@ -39,10 +41,14 @@ public static class Recognize extends ExpandableStringEnum { public static class Play extends ExpandableStringEnum { /** Action failed, file could not be downloaded. */ public static final ReasonCode DOWNLOAD_FAILED = fromReasonCode(8536); - /** Action failed, file could not be downloaded. */ + /** Action failed, invalid file format. */ public static final ReasonCode INVALID_FILE_FORMAT = fromReasonCode(8535); /** Action failed, cognitive service play error. */ public static final ReasonCode COGNITEIVE_SERVICE_PLAY_ERROR = fromReasonCode(8565); + /** Action failed, text or ssml play source empty. */ + public static final ReasonCode TEXT_OR_SSML_SOURCE_EMPTY = fromReasonCode(8582); + /** Action failed, cognitive services error. */ + public static final ReasonCode COGNITIVE_SERVICES_ERROR = fromReasonCode(8565); } /** Action completed successfully. */ @@ -56,7 +62,7 @@ public static class Play extends ExpandableStringEnum { * @param reasonCode a reasonCode to look for. * @return the corresponding ResourceCode. */ - private static ReasonCode fromString(String reasonCode) { + public static ReasonCode fromString(String reasonCode) { return fromString(reasonCode, ReasonCode.class); } @@ -69,4 +75,13 @@ private static ReasonCode fromString(String reasonCode) { static ReasonCode fromReasonCode(int reasonCode) { return fromString(Integer.toString(reasonCode)); } + + /** + * Gets known ReasonCode values. + * + * @return known ReasonCode values. + */ + public static Collection values() { + return values(ReasonCode.class); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfCompleted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java similarity index 79% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfCompleted.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java index 6a2282777d183..15dcbf2d90290 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfCompleted.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java @@ -6,9 +6,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The SendDtmfCompleted model. */ +/** The SendDtmfTonesCompleted model. */ @Immutable -public final class SendDtmfCompleted extends CallAutomationEventBase { +public final class SendDtmfTonesCompleted extends CallAutomationEventBase { /* * Contains the resulting SIP code, sub-code and message. @@ -17,9 +17,9 @@ public final class SendDtmfCompleted extends CallAutomationEventBase { private final ResultInformation resultInformation; /** - * Constructor for ContinuousDtmfRecognitionToneReceived + * Constructor for SendDtmfTonesCompleted */ - public SendDtmfCompleted() { + public SendDtmfTonesCompleted() { resultInformation = null; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java similarity index 80% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfFailed.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java index ac7794255da11..67c8aeb6d9023 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfFailed.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java @@ -6,9 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The SendDtmfFailed model. */ +/** The SendDtmfTonesFailed model. */ @Fluent -public final class SendDtmfFailed extends CallAutomationEventBase { +public final class SendDtmfTonesFailed extends CallAutomationEventBase { /* * Contains the resulting SIP code, sub-code and message. @@ -17,9 +17,9 @@ public final class SendDtmfFailed extends CallAutomationEventBase { private final ResultInformation resultInformation; /** - * Constructor for ContinuousDtmfRecognitionToneReceived + * Constructor for SendDtmfTonesFailed */ - public SendDtmfFailed() { + public SendDtmfTonesFailed() { resultInformation = null; } 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 91a5fa7fc254e..0d0e94ffdbeab 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 classes 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.models; diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java index b6e9b6acb0032..fefc85dd7482c 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java @@ -17,6 +17,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.test.annotation.DoNotRecord; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -32,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallAutomationAsyncClientAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -133,6 +136,7 @@ public void createVOIPCallAndAnswerThenHangupAutomatedTest(HttpClient httpClient } } + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") 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 b9fbbe24c0f01..6b2cbf1f8ee92 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,7 +7,7 @@ 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.AddParticipantCancelled; +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; @@ -35,8 +35,8 @@ 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.SendDtmfCompleted; -import com.azure.communication.callautomation.models.events.SendDtmfFailed; +import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; +import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; import org.junit.jupiter.api.Test; import java.util.List; @@ -387,11 +387,8 @@ public void parseContinuousDtmfRecognitionToneReceivedEvent() { + " \"message\":\"DTMF tone received successfully.\"\n" + " },\n" + " \"type\":\"ContinuousDtmfRecognitionToneReceived\",\n" - + " \"toneInfo\":{\n" - + " \"sequenceId\":1,\n" - + " \"tone\":\"eight\",\n" - + " \"participantId\":\"267e33a9-c28e-4ecf-a33e-b3abd9526e32\"\n" - + " },\n" + + " \"sequenceId\":1,\n" + + " \"tone\":\"eight\",\n" + " \"callConnectionId\":\"callConnectionId\",\n" + " \"serverCallId\":\"serverCallId\",\n" + " \"correlationId\":\"correlationId\",\n" @@ -413,8 +410,8 @@ public void parseContinuousDtmfRecognitionToneReceivedEvent() { assertNotNull(continuousDtmfRecognitionToneReceived); assertEquals("serverCallId", continuousDtmfRecognitionToneReceived.getServerCallId()); assertEquals("callConnectionId", continuousDtmfRecognitionToneReceived.getCallConnectionId()); - assertEquals("eight", continuousDtmfRecognitionToneReceived.getToneInfo().getTone().toString()); - assertEquals(1, continuousDtmfRecognitionToneReceived.getToneInfo().getSequenceId()); + assertEquals("eight", continuousDtmfRecognitionToneReceived.getTone().toString()); + assertEquals(1, continuousDtmfRecognitionToneReceived.getSequenceId()); assertEquals("correlationId", continuousDtmfRecognitionToneReceived.getCorrelationId()); assertEquals(200, continuousDtmfRecognitionToneReceived.getResultInformation().getCode()); assertEquals(0, continuousDtmfRecognitionToneReceived.getResultInformation().getSubCode()); @@ -513,22 +510,22 @@ public void parseContinuousDtmfRecognitionStoppedEvent() { } @Test - public void parseSendDtmfCompletedEvent() { + public void parseSendDtmfTonesCompletedEvent() { String receivedEvent = "[\n" + " {\n" + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfCompleted\",\n" - + " \"type\":\"Microsoft.Communication.SendDtmfCompleted\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" + + " \"type\":\"Microsoft.Communication.SendDtmfTonesCompleted\",\n" + " \"specversion\":\"1.0\",\n" + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfCompleted\",\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" + " \"resultInformation\":{\n" + " \"code\":200,\n" + " \"subCode\":0,\n" + " \"message\":\"Send DTMF completed successfully.\"\n" + " },\n" - + " \"type\":\"SendDtmfCompleted\",\n" + + " \"type\":\"SendDtmfTonesCompleted\",\n" + " \"callConnectionId\":\"callConnectionId\",\n" + " \"serverCallId\":\"serverCallId\",\n" + " \"correlationId\":\"correlationId\",\n" @@ -536,7 +533,7 @@ public void parseSendDtmfCompletedEvent() { + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + " \"specversion\":\"1.0\",\n" + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfCompleted\"\n" + + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\"\n" + " }\n" + " }\n" + "]"; @@ -545,35 +542,35 @@ public void parseSendDtmfCompletedEvent() { assertNotNull(event); - SendDtmfCompleted sendDtmfCompleted = (SendDtmfCompleted) event; + SendDtmfTonesCompleted sendDtmfTonesCompleted = (SendDtmfTonesCompleted) event; - assertNotNull(sendDtmfCompleted); - assertEquals("serverCallId", sendDtmfCompleted.getServerCallId()); - assertEquals("callConnectionId", sendDtmfCompleted.getCallConnectionId()); - assertEquals("correlationId", sendDtmfCompleted.getCorrelationId()); - assertEquals(200, sendDtmfCompleted.getResultInformation().getCode()); - assertEquals(0, sendDtmfCompleted.getResultInformation().getSubCode()); - assertEquals("context", sendDtmfCompleted.getOperationContext()); - assertEquals("Send DTMF completed successfully.", sendDtmfCompleted.getResultInformation().getMessage()); + assertNotNull(sendDtmfTonesCompleted); + assertEquals("serverCallId", sendDtmfTonesCompleted.getServerCallId()); + assertEquals("callConnectionId", sendDtmfTonesCompleted.getCallConnectionId()); + assertEquals("correlationId", sendDtmfTonesCompleted.getCorrelationId()); + assertEquals(200, sendDtmfTonesCompleted.getResultInformation().getCode()); + assertEquals(0, sendDtmfTonesCompleted.getResultInformation().getSubCode()); + assertEquals("context", sendDtmfTonesCompleted.getOperationContext()); + assertEquals("Send DTMF completed successfully.", sendDtmfTonesCompleted.getResultInformation().getMessage()); } @Test - public void parseSendDtmfFailedEvent() { + public void parseSendDtmfTonesFailedEvent() { String receivedEvent = "[\n" + " {\n" + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfFailed\",\n" - + " \"type\":\"Microsoft.Communication.SendDtmfFailed\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" + + " \"type\":\"Microsoft.Communication.SendDtmfTonesFailed\",\n" + " \"specversion\":\"1.0\",\n" + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfFailed\",\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" + " \"resultInformation\":{\n" + " \"code\":200,\n" + " \"subCode\":0,\n" + " \"message\":\"Send DTMF couldn't be completed successfully.\"\n" + " },\n" - + " \"type\":\"SendDtmfFailed\",\n" + + " \"type\":\"SendDtmfTonesFailed\",\n" + " \"callConnectionId\":\"callConnectionId\",\n" + " \"serverCallId\":\"serverCallId\",\n" + " \"correlationId\":\"correlationId\",\n" @@ -581,7 +578,7 @@ public void parseSendDtmfFailedEvent() { + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + " \"specversion\":\"1.0\",\n" + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfFailed\"\n" + + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\"\n" + " }\n" + " }\n" + "]"; @@ -590,16 +587,16 @@ public void parseSendDtmfFailedEvent() { assertNotNull(event); - SendDtmfFailed sendDtmfFailed = (SendDtmfFailed) event; + SendDtmfTonesFailed sendDtmfTonesFailed = (SendDtmfTonesFailed) event; - assertNotNull(sendDtmfFailed); - assertEquals("serverCallId", sendDtmfFailed.getServerCallId()); - assertEquals("callConnectionId", sendDtmfFailed.getCallConnectionId()); - assertEquals("correlationId", sendDtmfFailed.getCorrelationId()); - assertEquals(200, sendDtmfFailed.getResultInformation().getCode()); - assertEquals(0, sendDtmfFailed.getResultInformation().getSubCode()); - assertEquals("context", sendDtmfFailed.getOperationContext()); - assertEquals("Send DTMF couldn't be completed successfully.", sendDtmfFailed.getResultInformation().getMessage()); + assertNotNull(sendDtmfTonesFailed); + assertEquals("serverCallId", sendDtmfTonesFailed.getServerCallId()); + assertEquals("callConnectionId", sendDtmfTonesFailed.getCallConnectionId()); + assertEquals("correlationId", sendDtmfTonesFailed.getCorrelationId()); + assertEquals(200, sendDtmfTonesFailed.getResultInformation().getCode()); + assertEquals(0, sendDtmfTonesFailed.getResultInformation().getSubCode()); + assertEquals("context", sendDtmfTonesFailed.getOperationContext()); + assertEquals("Send DTMF couldn't be completed successfully.", sendDtmfTonesFailed.getResultInformation().getMessage()); } @Test @@ -664,19 +661,13 @@ public void parseTransferAccptedEvent() { } @Test - public void parseAndProcessAddParticipantCancelledEvent() { + public void parseCancelAddParticipantSucceededEvent() { String receivedEvent = "[{\n" + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.AddParticipantCancelled\",\n" + + "\"type\": \"Microsoft.Communication.CancelAddParticipantSucceeded\",\n" + "\"data\": {\n" + "\"operationContext\": \"context\",\n" - + "\"participant\": {\n" - + "\"rawId\": \"rawId\",\n" - + "\"phoneNumber\": {\n" - + "\"value\": \"value\"\n" - + "}\n" - + "},\n" + "\"callConnectionId\": \"callConnectionId\",\n" + "\"serverCallId\": \"serverCallId\",\n" + "\"invitationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\",\n" @@ -691,25 +682,12 @@ public void parseAndProcessAddParticipantCancelledEvent() { CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); assertNotNull(event); - AddParticipantCancelled addParticipantCancelled = (AddParticipantCancelled) event; + CancelAddParticipantSucceeded cancelAddParticipantSucceeded = (CancelAddParticipantSucceeded) event; - assertNotNull(addParticipantCancelled); - assertEquals("serverCallId", addParticipantCancelled.getServerCallId()); - assertEquals("callConnectionId", addParticipantCancelled.getCallConnectionId()); - assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", addParticipantCancelled.getInvitationId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.attachOngoingEventProcessor(addParticipantCancelled.getCallConnectionId(), - eventToHandle -> { - assertEquals("serverCallId", eventToHandle.getServerCallId()); - assertEquals("callConnectionId", eventToHandle.getCallConnectionId()); - assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", eventToHandle.getInvitationId()); - }, AddParticipantCancelled.class); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.detachOngoingEventProcessor(addParticipantCancelled.getCallConnectionId(), AddParticipantCancelled.class); + assertNotNull(cancelAddParticipantSucceeded); + assertEquals("serverCallId", cancelAddParticipantSucceeded.getServerCallId()); + assertEquals("callConnectionId", cancelAddParticipantSucceeded.getCallConnectionId()); + assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", cancelAddParticipantSucceeded.getInvitationId()); } @Test 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 cf32f8f785fa1..29a8c2dfd0d5d 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 @@ -16,7 +16,6 @@ import com.azure.communication.callautomation.implementation.models.CallParticipantInternal; import com.azure.communication.callautomation.implementation.models.GetParticipantsResponseInternal; import com.azure.communication.callautomation.implementation.models.DialogStateResponse; -import com.azure.communication.callautomation.implementation.models.DialogInputType; import com.azure.communication.callautomation.models.MediaStreamingAudioChannel; import com.azure.communication.callautomation.models.MediaStreamingOptions; import com.azure.communication.callautomation.models.MediaStreamingContent; @@ -85,7 +84,7 @@ public static String generateGetParticipantResponse(String callerId, boolean isM public static String generateListParticipantsResponse() { GetParticipantsResponseInternal getParticipantsResponseInternal = new GetParticipantsResponseInternal() - .setValues(new ArrayList<>(Arrays.asList( + .setValue(new ArrayList<>(Arrays.asList( ModelGenerator.generateAcsCallParticipantInternal(CALL_CALLER_ID, false), ModelGenerator.generateAcsCallParticipantInternal(CALL_TARGET_ID, true)))) .setNextLink(""); @@ -103,8 +102,7 @@ public static String generateAddParticipantsResponse() { public static String generateDialogStateResponse() { DialogStateResponse dialogStateResponse = new DialogStateResponse() - .setDialogId(DIALOG_ID) - .setDialogInputType(DialogInputType.POWER_VIRTUAL_AGENTS); + .setDialogId(DIALOG_ID); return serializeObject(dialogStateResponse); } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java index 03e6f9be4709d..00956c897600a 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java @@ -9,20 +9,22 @@ import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallParticipant; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; import com.azure.communication.callautomation.models.CreateCallResult; import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallConnected; import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; -import com.azure.communication.callautomation.models.events.AddParticipantCancelled; +import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.test.annotation.DoNotRecord; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -38,6 +40,8 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallConnectionAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -157,6 +161,7 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAut } } + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -236,15 +241,15 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant Thread.sleep(3000); // cancel add participant - CancelAddParticipantResult cancelAddParticipantResponse = createCallResult + CancelAddParticipantOperationResult cancelAddParticipantResponse = createCallResult .getCallConnectionAsync() - .cancelAddParticipant(addParticipantsResultResponse.getValue().getInvitationId()) + .cancelAddParticipantOperation(addParticipantsResultResponse.getValue().getInvitationId()) .block(); assertNotNull(cancelAddParticipantResponse); - // wait for addParticipantSucceed - AddParticipantCancelled addParticipantCancelled = waitForEvent(AddParticipantCancelled.class, callerConnectionId, Duration.ofSeconds(10)); - assertNotNull(addParticipantCancelled); + // wait for CancelAddParticipantSucceeded + CancelAddParticipantSucceeded cancelAddParticipantSucceeded = waitForEvent(CancelAddParticipantSucceeded.class, callerConnectionId, Duration.ofSeconds(10)); + assertNotNull(cancelAddParticipantSucceeded); } catch (Exception ex) { fail("Unexpected exception received", ex); } finally { 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 7cd5df839e853..405f22bf46db0 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 @@ -4,7 +4,7 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; -import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; @@ -13,16 +13,16 @@ 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.CancelAddParticipantOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; -import com.azure.communication.callautomation.models.MuteParticipantsOptions; -import com.azure.communication.callautomation.models.MuteParticipantsResult; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; +import com.azure.communication.callautomation.models.MuteParticipantOptions; +import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.TransferCallResult; import com.azure.communication.callautomation.models.TransferCallToParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsResult; +import com.azure.communication.callautomation.models.UnmuteParticipantOptions; +import com.azure.communication.callautomation.models.UnmuteParticipantResult; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.http.rest.Response; @@ -31,13 +31,11 @@ import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; public class CallConnectionAsyncUnitTests extends CallAutomationUnitTestBase { @@ -185,7 +183,7 @@ public void transferToParticipantCallWithResponse() { assertEquals(202, transferCallResultResponse.getStatusCode()); assertNotNull(transferCallResultResponse.getValue()); } - + @Test public void transferToParticipantCallWithResponseWithTrasferee() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( @@ -279,35 +277,32 @@ public void removeParticipantsWithResponse() { } @Test - public void muteParticipants() { + public void muteParticipant() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal()), 202) + new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal()), 202) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - MuteParticipantsResult muteParticipantsResult = callConnectionAsync.muteParticipantsAsync( - new CommunicationUserIdentifier(CALL_TARGET_ID)).block(); + MuteParticipantResult muteParticipantResultResponse = callConnectionAsync.muteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)).block(); - assertNotNull(muteParticipantsResult); - assertNull(muteParticipantsResult.getOperationContext()); + assertNotNull(muteParticipantResultResponse); } @Test - public void muteParticipantsWithResponse() { + public void muteParticipantWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal() + new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal() .setOperationContext(CALL_OPERATION_CONTEXT)), 202) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - MuteParticipantsOptions muteParticipantsOptions = new MuteParticipantsOptions( - Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))) + MuteParticipantOptions options = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) .setOperationContext(CALL_OPERATION_CONTEXT); - Response muteParticipantsResultResponse = - callConnectionAsync.muteParticipantsWithResponse(muteParticipantsOptions).block(); + Response muteParticipantsResultResponse = + callConnectionAsync.muteParticipantWithResponse(options).block(); assertNotNull(muteParticipantsResultResponse); assertEquals(202, muteParticipantsResultResponse.getStatusCode()); @@ -322,7 +317,7 @@ public void muteParticipantNotFound() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - assertThrows(HttpResponseException.class, () -> callConnectionAsync.muteParticipantsAsync( + assertThrows(HttpResponseException.class, () -> callConnectionAsync.muteParticipant( new CommunicationUserIdentifier(CALL_TARGET_ID)).block()); } @@ -334,54 +329,32 @@ public void muteNotAcsParticipant() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - assertThrows(HttpResponseException.class, () -> callConnectionAsync.muteParticipantsAsync( + assertThrows(HttpResponseException.class, () -> callConnectionAsync.muteParticipant( new PhoneNumberIdentifier("+11234567890")).block()); } @Test - public void muteMoreThanOneParticipantWithResponse() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>("", 400) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - MuteParticipantsOptions muteParticipantOptions = new MuteParticipantsOptions( - Arrays.asList( - new CommunicationUserIdentifier(CALL_TARGET_ID), - new CommunicationUserIdentifier(CALL_TARGET_ID) - )) - .setOperationContext(CALL_OPERATION_CONTEXT); - - assertThrows(HttpResponseException.class, - () -> callConnectionAsync.muteParticipantsWithResponse(muteParticipantOptions).block()); - } - - @Test - public void unmuteParticipants() { + public void unmuteParticipant() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 202) + new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - UnmuteParticipantsResult unmuteParticipantsResult = callConnectionAsync.unmuteParticipantsAsync( - new CommunicationUserIdentifier(CALL_TARGET_ID) - ).block(); + UnmuteParticipantResult unmuteParticipantResult = callConnectionAsync.unmuteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)).block(); - assertNotNull(unmuteParticipantsResult); - assertNull(unmuteParticipantsResult.getOperationContext()); + assertNotNull(unmuteParticipantResult); } @Test - public void unmuteParticipantsNotFound() { + public void unmuteParticipantNotFound() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>("", 404) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipantsAsync( + assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipant( new CommunicationUserIdentifier(CALL_TARGET_ID)).block()); } @@ -393,50 +366,30 @@ public void unmuteNotAcsParticipant() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipantsAsync( + assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipant( new PhoneNumberIdentifier("+11234567890")).block()); } @Test - public void unmuteParticipantsWithResponse() { + public void unmuteParticipantWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal() - .setOperationContext(CALL_OPERATION_CONTEXT)), 202) + .setOperationContext(CALL_OPERATION_CONTEXT)), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - UnmuteParticipantsOptions muteParticipantOptions = new UnmuteParticipantsOptions( - Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))) + UnmuteParticipantOptions unmuteParticipantOptions = new UnmuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) .setOperationContext(CALL_OPERATION_CONTEXT); - Response unmuteParticipantsResultResponse = - callConnectionAsync.unmuteParticipantsWithResponse(muteParticipantOptions).block(); + Response unmuteParticipantsResultResponse = + callConnectionAsync.unmuteParticipantWithResponse(unmuteParticipantOptions).block(); assertNotNull(unmuteParticipantsResultResponse); - assertEquals(202, unmuteParticipantsResultResponse.getStatusCode()); + assertEquals(200, unmuteParticipantsResultResponse.getStatusCode()); assertNotNull(unmuteParticipantsResultResponse.getValue()); } - @Test - public void unmuteMoreThanOneParticipantWithResponse() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>("", 400) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - UnmuteParticipantsOptions muteParticipantOptions = new UnmuteParticipantsOptions( - Arrays.asList( - new CommunicationUserIdentifier(CALL_TARGET_ID), - new CommunicationUserIdentifier(CALL_TARGET_ID) - )) - .setOperationContext(CALL_OPERATION_CONTEXT); - - assertThrows(HttpResponseException.class, - () -> callConnectionAsync.unmuteParticipantsWithResponse(muteParticipantOptions).block()); - } - @Test public void cancelAddParticipant() { String invitationId = "invitationId"; @@ -449,7 +402,7 @@ public void cancelAddParticipant() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - CancelAddParticipantResult result = callConnectionAsync.cancelAddParticipant(invitationId).block(); + CancelAddParticipantOperationResult result = callConnectionAsync.cancelAddParticipantOperation(invitationId).block(); assertNotNull(result); assertEquals(CALL_OPERATION_CONTEXT, result.getOperationContext()); @@ -468,9 +421,9 @@ public void cancelAddParticipantWithResponse() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - CancelAddParticipantOptions options = new CancelAddParticipantOptions(invitationId) + CancelAddParticipantOperationOptions options = new CancelAddParticipantOperationOptions(invitationId) .setOperationContext(CALL_OPERATION_CONTEXT); - Response response = callConnectionAsync.cancelAddParticipantWithResponse( + Response response = callConnectionAsync.cancelAddParticipantOperationWithResponse( options).block(); 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 a57a4c028ff39..12bd132e4b032 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 @@ -4,7 +4,7 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; -import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; @@ -13,16 +13,16 @@ 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.CancelAddParticipantOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantResult; -import com.azure.communication.callautomation.models.MuteParticipantsOptions; -import com.azure.communication.callautomation.models.MuteParticipantsResult; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; +import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; +import com.azure.communication.callautomation.models.MuteParticipantOptions; +import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.TransferCallResult; import com.azure.communication.callautomation.models.TransferCallToParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantsResult; +import com.azure.communication.callautomation.models.UnmuteParticipantOptions; +import com.azure.communication.callautomation.models.UnmuteParticipantResult; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -37,7 +37,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; public class CallConnectionUnitTests extends CallAutomationUnitTestBase { @Test @@ -259,54 +258,51 @@ public void removeParticipantsWithResponse() { } @Test - public void muteParticipants() { + public void muteParticipant() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal()), 202) + new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal()), 202) ))) .getCallConnection(CALL_CONNECTION_ID); - MuteParticipantsResult muteParticipantsResult = - callConnection.muteParticipants(new CommunicationUserIdentifier(CALL_TARGET_ID)); + MuteParticipantResult muteParticipantResult = + callConnection.muteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)); - assertNotNull(muteParticipantsResult); - assertNull(muteParticipantsResult.getOperationContext()); + assertNotNull(muteParticipantResult); } @Test - public void muteParticipantsWithResponse() { + public void muteParticipantWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal() + new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal() .setOperationContext(CALL_OPERATION_CONTEXT)), 202) ))) .getCallConnection(CALL_CONNECTION_ID); - MuteParticipantsOptions muteParticipantsOptions = new MuteParticipantsOptions( - Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))) + MuteParticipantOptions muteParticipantOptions = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) .setOperationContext(CALL_OPERATION_CONTEXT); - Response muteParticipantsResultResponse = - callConnection.muteParticipantsWithResponse(muteParticipantsOptions, Context.NONE); + Response muteParticipantResultResponse = + callConnection.muteParticipantWithResponse(muteParticipantOptions, Context.NONE); - assertNotNull(muteParticipantsResultResponse); - assertEquals(202, muteParticipantsResultResponse.getStatusCode()); - assertNotNull(muteParticipantsResultResponse.getValue()); + assertNotNull(muteParticipantResultResponse); + assertEquals(202, muteParticipantResultResponse.getStatusCode()); + assertNotNull(muteParticipantResultResponse.getValue()); } @Test public void unmuteParticipant() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 202) + new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 200) ))) .getCallConnection(CALL_CONNECTION_ID); - UnmuteParticipantsResult unmuteParticipantsResult = - callConnection.unmuteParticipants(new CommunicationUserIdentifier(CALL_TARGET_ID)); + UnmuteParticipantResult unmuteParticipantsResult = + callConnection.unmuteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)); assertNotNull(unmuteParticipantsResult); - assertNull(unmuteParticipantsResult.getOperationContext()); } @Test @@ -314,20 +310,19 @@ public void unmuteParticipantWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal() - .setOperationContext(CALL_OPERATION_CONTEXT)), 202) + .setOperationContext(CALL_OPERATION_CONTEXT)), 200) ))) .getCallConnection(CALL_CONNECTION_ID); - UnmuteParticipantsOptions muteParticipantOptions = new UnmuteParticipantsOptions( - Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))) + UnmuteParticipantOptions muteParticipantOptions = new UnmuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) .setOperationContext(CALL_OPERATION_CONTEXT); - Response unmuteParticipantsResultResponse = - callConnection.unmuteParticipantsWithResponse(muteParticipantOptions, Context.NONE); + Response unmuteParticipantResultResponse = + callConnection.unmuteParticipantWithResponse(muteParticipantOptions, Context.NONE); - assertNotNull(unmuteParticipantsResultResponse); - assertEquals(202, unmuteParticipantsResultResponse.getStatusCode()); - assertNotNull(unmuteParticipantsResultResponse.getValue()); + assertNotNull(unmuteParticipantResultResponse); + assertEquals(200, unmuteParticipantResultResponse.getStatusCode()); + assertNotNull(unmuteParticipantResultResponse.getValue()); } @Test @@ -342,7 +337,7 @@ public void cancelAddParticipant() { ))) .getCallConnection(CALL_CONNECTION_ID); - CancelAddParticipantResult result = callConnection.cancelAddParticipant(invitationId); + CancelAddParticipantOperationResult result = callConnection.cancelAddParticipantOperation(invitationId); assertNotNull(result); assertEquals(CALL_OPERATION_CONTEXT, result.getOperationContext()); @@ -361,9 +356,9 @@ public void cancelAddParticipantWithResponse() { ))) .getCallConnection(CALL_CONNECTION_ID); - CancelAddParticipantOptions options = new CancelAddParticipantOptions(invitationId) + CancelAddParticipantOperationOptions options = new CancelAddParticipantOperationOptions(invitationId) .setOperationContext(CALL_OPERATION_CONTEXT); - Response response = callConnection.cancelAddParticipantWithResponse( + Response response = callConnection.cancelAddParticipantOperationWithResponse( options, Context.NONE); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java index 1da19d1b6fc04..749503fb13cda 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java @@ -3,7 +3,6 @@ package com.azure.communication.callautomation; -import com.azure.communication.callautomation.models.DialogInputType; import com.azure.communication.callautomation.models.*; import com.azure.communication.callautomation.models.events.CallConnected; import com.azure.communication.callautomation.models.events.DialogCompleted; @@ -14,6 +13,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.test.annotation.DoNotRecord; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -24,6 +25,8 @@ import static org.junit.jupiter.api.Assertions.*; public class CallDialogAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java index e0ffd6dab69cc..f3a25ab131d95 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java @@ -14,7 +14,7 @@ import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionStopped; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneReceived; import com.azure.communication.callautomation.models.events.PlayCompleted; -import com.azure.communication.callautomation.models.events.SendDtmfCompleted; +import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.PhoneNumberIdentifier; @@ -26,6 +26,8 @@ import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.core.test.annotation.DoNotRecord; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -42,6 +44,8 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallMediaAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -129,6 +133,7 @@ public void playMediaInACallAutomatedTest(HttpClient httpClient) { } } + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -213,7 +218,7 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { callMediaAsync.startContinuousDtmfRecognition(receiver).block(); // send Dtmf tones to target - callMediaAsync.sendDtmf(Stream.of(DtmfTone.A, DtmfTone.B).collect(Collectors.toList()), receiver).block(); + callMediaAsync.sendDtmfTones(Stream.of(DtmfTone.A, DtmfTone.B).collect(Collectors.toList()), receiver).block(); // wait for ContinuousDtmfRecognitionToneReceived ContinuousDtmfRecognitionToneReceived continuousDtmfRecognitionToneReceived = waitForEvent( @@ -222,7 +227,7 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { assertNotNull(continuousDtmfRecognitionToneReceived); // validate SendDtmfCompleted - SendDtmfCompleted sendDtmfCompleted = waitForEvent(SendDtmfCompleted.class, callerConnectionId, Duration.ofSeconds(20)); + SendDtmfTonesCompleted sendDtmfCompleted = waitForEvent(SendDtmfTonesCompleted.class, callerConnectionId, Duration.ofSeconds(20)); assertNotNull(sendDtmfCompleted); // stop continuous dtmf 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 ea959cd80ea82..29f78ea67c389 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 @@ -4,19 +4,22 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.models.PlayToAllOptions; -import com.azure.communication.callautomation.models.RecognizeChoice; +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; import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeSpeechOrDtmfOptions; +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.GenderType; +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.RecognizeInputType; +import com.azure.communication.callautomation.models.SendDtmfTonesOptions; import com.azure.communication.common.CommunicationUserIdentifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -47,12 +50,12 @@ public void setup() { callMedia = getMockCallMedia(202); playFileSource = new FileSource(); - playFileSource.setPlaySourceId("playFileSourceId"); + playFileSource.setPlaySourceCacheId("playFileSourceId"); playFileSource.setUrl("filePath"); playTextSource = new TextSource(); - playTextSource.setPlaySourceId("playTextSourceId"); - playTextSource.setVoiceGender(GenderType.MALE); + playTextSource.setPlaySourceCacheId("playTextSourceId"); + playTextSource.setVoiceKind(VoiceKind.MALE); playTextSource.setSourceLocale("en-US"); playTextSource.setVoiceName("LULU"); playTextSource.setCustomVoiceEndpointId("customVoiceEndpointId"); @@ -174,10 +177,10 @@ public void recognizeWithResponseWithFileSourceDtmfOptions() { public void startContinuousDtmfRecognitionWithResponse() { // override callMedia to mock 200 response code callMedia = getMockCallMedia(200); + ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); StepVerifier.create( - callMedia.startContinuousDtmfRecognitionWithResponse(new CommunicationUserIdentifier("id"), - "operationContext") - ) + callMedia.startContinuousDtmfRecognitionWithResponse( + options)) .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) .verifyComplete(); } @@ -186,24 +189,28 @@ public void startContinuousDtmfRecognitionWithResponse() { public void stopContinuousDtmfRecognitionWithResponse() { // override callMedia to mock 200 response code callMedia = getMockCallMedia(200); + ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); StepVerifier.create( - callMedia.stopContinuousDtmfRecognitionWithResponse(new CommunicationUserIdentifier("id"), - "operationContext", null) - ) + callMedia.stopContinuousDtmfRecognitionWithResponse( + options)) .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) .verifyComplete(); } @Test public void sendDtmfWithResponse() { - StepVerifier.create( - callMedia.sendDtmfWithResponse( - Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()), new CommunicationUserIdentifier("id"), - "operationContext", - null - ) - ).consumeNextWith(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); + CallConnectionAsync callConnection = + CallAutomationUnitTestBase.getCallConnectionAsync(new ArrayList<>( + Collections.singletonList(new AbstractMap.SimpleEntry<>( + CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext("operationContext")), 202))) + ); + callMedia = callConnection.getCallMediaAsync(); + List tones = Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()); + SendDtmfTonesOptions options = new SendDtmfTonesOptions(tones, new CommunicationUserIdentifier("id")); + options.setOperationContext("operationContext"); + options.setOperationCallbackUrl(CallAutomationUnitTestBase.CALL_CALLBACK_URL); + StepVerifier.create(callMedia.sendDtmfTonesWithResponse(options)) + .consumeNextWith(response -> assertEquals(202, response.getStatusCode())).verifyComplete(); } @Test @@ -235,11 +242,11 @@ public void recognizeWithResponseWithTextSourceDtmfOptions() { @Test public void recognizeWithResponseWithFileSourceChoiceOptions() { - RecognizeChoice recognizeChoice1 = new RecognizeChoice(); - RecognizeChoice recognizeChoice2 = new RecognizeChoice(); + RecognitionChoice recognizeChoice1 = new RecognitionChoice(); + RecognitionChoice recognizeChoice2 = new RecognitionChoice(); recognizeChoice1.setTone(DtmfTone.ZERO); recognizeChoice2.setTone(DtmfTone.SIX); - List recognizeChoices = new ArrayList<>( + List recognizeChoices = new ArrayList<>( Arrays.asList(recognizeChoice1, recognizeChoice2) ); CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); @@ -263,11 +270,11 @@ public void recognizeWithResponseWithFileSourceChoiceOptions() { @Test public void recognizeWithResponseTextChoiceOptions() { - RecognizeChoice recognizeChoice1 = new RecognizeChoice(); - RecognizeChoice recognizeChoice2 = new RecognizeChoice(); + RecognitionChoice recognizeChoice1 = new RecognitionChoice(); + RecognitionChoice recognizeChoice2 = new RecognitionChoice(); recognizeChoice1.setTone(DtmfTone.ZERO); recognizeChoice2.setTone(DtmfTone.THREE); - List recognizeChoices = new ArrayList<>( + List recognizeChoices = new ArrayList<>( Arrays.asList(recognizeChoice1, recognizeChoice2) ); CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); @@ -345,7 +352,7 @@ public void stopHoldMusicWithResponseTest() { callMedia = getMockCallMedia(200); StepVerifier.create( - callMedia.stopHoldMusicWithResponseAsync( + callMedia.stopHoldMusicWithResponse( new CommunicationUserIdentifier("id"), "operationalContext" )) 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 5ca2c44dc9914..8e43e024c0487 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 @@ -3,6 +3,7 @@ package com.azure.communication.callautomation; +import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; import com.azure.communication.callautomation.models.*; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.rest.Response; @@ -37,12 +38,12 @@ public void setup() { callMedia = callConnection.getCallMedia(); playFileSource = new FileSource(); - playFileSource.setPlaySourceId("playTextSourceId"); + playFileSource.setPlaySourceCacheId("playTextSourceId"); playFileSource.setUrl("filePath"); playTextSource = new TextSource(); - playTextSource.setPlaySourceId("playTextSourceId"); - playTextSource.setVoiceGender(GenderType.MALE); + playTextSource.setPlaySourceCacheId("playTextSourceId"); + playTextSource.setVoiceKind(VoiceKind.MALE); playTextSource.setSourceLocale("en-US"); playTextSource.setVoiceName("LULU"); playTextSource.setCustomVoiceEndpointId("customVoiceEndpointId"); @@ -99,9 +100,9 @@ public void recognizeWithDtmfResponseTest() { @Test public void recognizeWithChoiceResponseTest() { - RecognizeChoice recognizeChoice1 = new RecognizeChoice(); - RecognizeChoice recognizeChoice2 = new RecognizeChoice(); - List recognizeChoices = new ArrayList<>( + RecognitionChoice recognizeChoice1 = new RecognitionChoice(); + RecognitionChoice recognizeChoice2 = new RecognitionChoice(); + List recognizeChoices = new ArrayList<>( Arrays.asList(recognizeChoice1, recognizeChoice2) ); CallMediaRecognizeChoiceOptions callMediaRecognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); @@ -117,10 +118,8 @@ public void startContinuousDtmfRecognitionWithResponseTest() { Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) ); callMedia = callConnection.getCallMedia(); - Response response = callMedia.startContinuousDtmfRecognitionWithResponse( - new CommunicationUserIdentifier("id"), - "operationContext", Context.NONE - ); + ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); + Response response = callMedia.startContinuousDtmfRecognitionWithResponse(options, Context.NONE); assertEquals(response.getStatusCode(), 200); } @@ -132,19 +131,39 @@ public void stopContinuousDtmfRecognitionWithResponseTest() { Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) ); callMedia = callConnection.getCallMedia(); - Response response = callMedia.stopContinuousDtmfRecognitionWithResponse( - new CommunicationUserIdentifier("id"), - "operationContext", null, Context.NONE + ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); + Response response = callMedia.stopContinuousDtmfRecognitionWithResponse(options, Context.NONE ); assertEquals(response.getStatusCode(), 200); } @Test - public void sendDtmfWithResponseTest() { - Response response = callMedia.sendDtmfWithResponse( - Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()), new CommunicationUserIdentifier("id"), - "ctx", null, Context.NONE + public void sendDtmfTonesTest() { + CallConnection callConnection = + CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( + Collections.singletonList(new AbstractMap.SimpleEntry<>( + CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT)), 202))) + ); + //expect no exception + callConnection.getCallMedia().sendDtmfTones( + Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()), + new CommunicationUserIdentifier("id") ); + } + + @Test + public void sendDtmfTonesWithResponseTest() { + CallConnection callConnection = + CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( + Collections.singletonList(new AbstractMap.SimpleEntry<>( + CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT)), 202))) + ); + callMedia = callConnection.getCallMedia(); + List tones = Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()); + SendDtmfTonesOptions options = new SendDtmfTonesOptions(tones, new CommunicationUserIdentifier("id")); + options.setOperationContext("ctx"); + options.setOperationCallbackUrl(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT); + Response response = callMedia.sendDtmfTonesWithResponse(options, Context.NONE); assertEquals(response.getStatusCode(), 202); } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java index cb3572b3953f4..347eebad188d1 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java @@ -22,6 +22,8 @@ import com.azure.communication.identity.CommunicationIdentityClient; import com.azure.core.http.HttpClient; import com.azure.core.test.annotation.DoNotRecord; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -33,6 +35,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; public class CallRecordingAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -118,6 +122,7 @@ public void createACSCallAndUnmixedAudioTest(HttpClient httpClient) { } } + @Disabled("Disabled for now until live test fixed against live service") @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index 8e748e93ae81c..39fb90dc2b91c 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -21,14 +21,14 @@ There is one swagger for Calling management APIs. ```ps cd -autorest README.md --java --v4 --use=@autorest/java@4.0.20 --use=@autorest/modelerfour@4.15.442 +autorest README.md --java --v4 --use=@autorest/java@4.1.23 ``` ### Code generation settings ``` yaml -tag: package-2023-01-15-preview +tag: package-2023-10-03-preview require: - - https://github.com/williamzhao87/azure-rest-api-specs/blob/5b7321a923a30b83b978e3a30ed1d497e35052fd/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/4a12c91e35ff85ea2fbbb3b0bab0d432a68d00df/specification/communication/data-plane/CallAutomation/readme.md java: true output-folder: ../ license-header: MICROSOFT_MIT_SMALL @@ -85,6 +85,9 @@ directive: - rename-model: from: AnswerCallRequest to: AnswerCallRequestInternal +- rename-model: + from: CallIntelligenceOptions + to: CallIntelligenceOptionsInternal - rename-model: from: RedirectCallRequest to: RedirectCallRequestInternal @@ -125,11 +128,14 @@ directive: from: ContinuousDtmfRecognitionOptions to: ContinuousDtmfRecognitionOptionsInternal - rename-model: - from: SendDtmfOptions - to: SendDtmfOptionsInternal + from: SendDtmfTonesOptions + to: SendDtmfTonesOptionsInternal +- rename-model: + from: SendDtmfTonesRequest + to: SendDtmfTonesRequestInternal - rename-model: - from: SendDtmfRequest - to: SendDtmfRequestInternal + from: SendDtmfTonesResult + to: SendDtmfTonesResultInternal - rename-model: from: ChannelAffinity to: ChannelAffinityInternal @@ -153,13 +159,13 @@ directive: to: RecognizeOptionsInternal - rename-model: from: Choice - to: RecognizeChoiceInternal + to: RecognitionChoiceInternal - rename-model: from: MuteParticipantsRequest to: MuteParticipantsRequestInternal - rename-model: - from: MuteParticipantsResponse - to: MuteParticipantsResponseInternal + from: MuteParticipantsResult + to: MuteParticipantsResultInternal - rename-model: from: UnmuteParticipantsRequest to: UnmuteParticipantsRequestInternal @@ -190,9 +196,6 @@ directive: - rename-model: from: ContinuousDtmfRecognitionRequest to: ContinuousDtmfRecognitionRequestInternal -- rename-model: - from: SendDtmfRequest - to: SendDtmfRequestInternal - rename-model: from: StartDialogRequest to: StartDialogRequestInternal @@ -214,12 +217,14 @@ directive: - remove-model: RecognizeFailed - remove-model: RecognizeCanceled - remove-model: ContinuousDtmfRecognitionToneReceived -- remove-model: ToneInfo - remove-model: ContinuousDtmfRecognitionToneFailed - remove-model: ContinuousDtmfRecognitionStopped -- remove-model: SendDtmfCompleted -- remove-model: SendDtmfFailed -- remove-model: AddParticipantCancelled +- remove-model: SendDtmfTonesCompleted +- remove-model: SendDtmfTonesFailed +- remove-model: Choice +- remove-model: ChoiceResult +- remove-model: SpeechResult +- remove-model: CancelAddParticipantSucceeded - remove-model: CancelAddParticipantFailed - remove-model: DialogCompleted - remove-model: DialogConsent @@ -386,13 +391,22 @@ directive: $.name = "DtmfOptionsInternal"; ``` -### Rename Choice to GenderType +### Rename CallIntelligenceOptions to CallIntelligenceOptionsInternal +``` yaml +directive: +- from: swagger-document + where: $.definitions.CallIntelligenceOptions["x-ms-enum"] + transform: > + $.name = "CallIntelligenceOptionsInternal"; +``` + +### Rename VoiceKind to VoiceKindInternal ``` yaml directive: - from: swagger-document - where: $.definitions.Gender["x-ms-enum"] + where: $.definitions.VoiceKind["x-ms-enum"] transform: > - $.name = "GenderTypeInternal"; + $.name = "VoiceKindInternal"; ``` ### Rename RecordingStorageType to RecordingStorageTypeInternal