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